[PATCH] D52494: [InstCombine] Handle vector compares in foldGEPIcmp(), take 2

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 05:57:03 PDT 2018


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

Thanks, that is indeed what i expected to see.
One nit, but i'm really unsure of it.



================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:912
       // If all indices are the same, just compare the base pointers.
-      if (IndicesTheSame)
+      Type *BaseType = GEPLHS->getOperand(0)->getType();
+      if (IndicesTheSame && CmpInst::makeCmpResultType(BaseType) == I.getType())
----------------
I'm not sure this helper variable is/isn't any better than without it?


https://reviews.llvm.org/D52494





More information about the llvm-commits mailing list