[llvm] [GVNSink] Fix incorrect codegen with respect to GEPs #85333 (PR #88440)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 17:39:36 PDT 2024


================
@@ -719,12 +719,11 @@ GVNSink::analyzeInstructionForSinking(LockstepReverseIterator &LRI,
   // try and continue making progress.
   Instruction *I0 = NewInsts[0];
 
-  // If all instructions that are going to participate don't have the same
-  // number of operands, we can't do any useful PHI analysis for all operands.
-  auto hasDifferentNumOperands = [&I0](Instruction *I) {
-    return I->getNumOperands() != I0->getNumOperands();
+  auto hasDifferentOperands = [&I0](Instruction *I) {
----------------
nikic wrote:

nit: I'd rename this to something like...
```suggestion
  auto isNotSameOperation = [&I0](Instruction *I) {
```
...as the (non-type) operands may still be different.

https://github.com/llvm/llvm-project/pull/88440


More information about the llvm-commits mailing list