[PATCH] D48401: [InstCombine] fold vector select of binops with constant ops to 1 binop (PR37806)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 23:45:38 PDT 2018


lebedev.ri added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:1152
+
+  if (B0->getOpcode() == B1->getOpcode()) {
+    Value *X;
----------------
Do you envision adding other top-level `if`'s later?
Otherwise you could do early return.


================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:1170-1171
+      // binop to be undef.
+      if (B0->isIntDivRem())
+        NewC = getSafeVectorConstantForIntDivRem(NewC);
+
----------------
Hm, you are sure there is a test for this in `test/Transforms/InstCombine/shuffle_select.ll`?



https://reviews.llvm.org/D48401





More information about the llvm-commits mailing list