[PATCH] D69519: [InstCombine] make icmp vector canonicalization safe for constant with undef elements

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 12:47:59 PDT 2019


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

I didn't verify that alive no longer barfs on that transform,
but i do believe the change makes sense in the context of
the example provided in that bugreport.

Should there be a `icmp sge` test?

Other than that, thanks, LG.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5190
         return llvm::None;
+      SafeReplacementConstant = CI;
     }
----------------
This will result in the last one being used


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5198
+  // It may not be safe to change a compare predicate in the presence of
+  // undefined elements, so replace those elements with the first safe constant
+  // that we found.
----------------
with last safe constant we found


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69519/new/

https://reviews.llvm.org/D69519





More information about the llvm-commits mailing list