Skip to content

Commit e30aa40

Browse files
authored
Revert "[DomTree] Assert non-null block for pre-dom tree" (llvm#186831)
Reverts llvm#186790 Breaks buildbots, there are more SLPVectorizer problems. https://lab.llvm.org/buildbot/#/builders/52/builds/15810
1 parent 18d85a3 commit e30aa40

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

llvm/include/llvm/Support/GenericDomTree.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,11 @@ class DominatorTreeBase {
384384
private:
385385
std::optional<unsigned> getNodeIndex(const NodeT *BB) const {
386386
if constexpr (GraphHasNodeNumbers<NodeT *>) {
387+
// BB can be nullptr, map nullptr to index 0.
387388
assert(BlockNumberEpoch ==
388389
GraphTraits<ParentPtr>::getNumberEpoch(Parent) &&
389390
"dominator tree used with outdated block numbers");
390-
if constexpr (IsPostDom) {
391-
if (!BB)
392-
return 0; // BB may be nullptr for post-dominator tree, map to 0.
393-
} else
394-
assert(BB && "dominator tree block must be non-null");
395-
return GraphTraits<const NodeT *>::getNumber(BB) + 1;
391+
return BB ? GraphTraits<const NodeT *>::getNumber(BB) + 1 : 0;
396392
} else {
397393
if (auto It = NodeNumberMap.find(BB); It != NodeNumberMap.end())
398394
return It->second;

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28333,8 +28333,6 @@ bool SLPVectorizerPass::vectorizeGEPIndices(BasicBlock *BB, BoUpSLP &R) {
2833328333
const SCEV *SCEVI = SE->getSCEV(GEPList[I]);
2833428334
for (int J = I + 1; J < E && Candidates.size() > 1; ++J) {
2833528335
auto *GEPJ = GEPList[J];
28336-
if (!Candidates.count(GEPJ))
28337-
continue;
2833828336
const SCEV *SCEVJ = SE->getSCEV(GEPList[J]);
2833928337
if (isa<SCEVConstant>(SE->getMinusSCEV(SCEVI, SCEVJ))) {
2834028338
Candidates.remove(GEPI);

polly/lib/Analysis/ScopBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ void ScopBuilder::propagateDomainConstraintsToRegionExit(
637637
auto *RI = scop->getRegion().getRegionInfo();
638638
auto *BBReg = RI ? RI->getRegionFor(BB) : nullptr;
639639
auto *ExitBB = BBReg ? BBReg->getExit() : nullptr;
640-
if (!BBReg || BBReg->getEntry() != BB || !ExitBB || !scop->contains(ExitBB))
640+
if (!BBReg || BBReg->getEntry() != BB || !scop->contains(ExitBB))
641641
return;
642642

643643
// Do not propagate the domain if there is a loop backedge inside the region

0 commit comments

Comments
 (0)