Skip to content

Commit 2d987ba

Browse files
committed
Fix a wrong use of AA in FlattenCFG
1 parent f27081b commit 2d987ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/lib/Transforms/Utils/FlattenCFG.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,12 @@ bool FlattenCFGOpt::CompareIfRegionBlock(BasicBlock *Block1, BasicBlock *Block2,
357357
for (BasicBlock::iterator BI(PBI2), BE(PTI2); BI != BE; ++BI) {
358358
if (BI->mayReadFromMemory() || BI->mayWriteToMemory()) {
359359
// Check alias with Head2.
360-
if (!AA || !AA->isNoAlias(&*iter1, &*BI))
361-
return false;
360+
if (AA) {
361+
MemoryLocation Loc1 = MemoryLocation::get(&*iter1);
362+
MemoryLocation Loc2 = MemoryLocation::get(&*BI);
363+
if (!AA->isNoAlias(Loc1, Loc2))
364+
return false;
365+
}
362366
}
363367
}
364368
}

0 commit comments

Comments
 (0)