Skip to content

Commit e394f6a

Browse files
authored
Revert "[GVNSink] Fix incorrect codegen with respect to GEPs #85333 (#88440)"
This reverts commit 1c979ab.
1 parent a1423ba commit e394f6a

File tree

2 files changed

+5
-105
lines changed

2 files changed

+5
-105
lines changed

llvm/lib/Transforms/Scalar/GVNSink.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -719,11 +719,12 @@ GVNSink::analyzeInstructionForSinking(LockstepReverseIterator &LRI,
719719
// try and continue making progress.
720720
Instruction *I0 = NewInsts[0];
721721

722-
auto isNotSameOperation = [&I0](Instruction *I) {
723-
return !I0->isSameOperationAs(I);
722+
// If all instructions that are going to participate don't have the same
723+
// number of operands, we can't do any useful PHI analysis for all operands.
724+
auto hasDifferentNumOperands = [&I0](Instruction *I) {
725+
return I->getNumOperands() != I0->getNumOperands();
724726
};
725-
726-
if (any_of(NewInsts, isNotSameOperation))
727+
if (any_of(NewInsts, hasDifferentNumOperands))
727728
return std::nullopt;
728729

729730
for (unsigned OpNum = 0, E = I0->getNumOperands(); OpNum != E; ++OpNum) {

llvm/test/Transforms/GVNSink/different-gep-types.ll

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)