[PATCH] D81151: [InstCombine] Simplify compare of Phi with constant inputs against a constant

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 22:01:22 PDT 2020


mkazantsev marked an inline comment as done.
mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:1464
+    if (Phi->hasOneUse() &&
+        all_of(Phi->operands(), [](Value *V) { return isa<ConstantInt>(V); })) {
+      Type *Ty = Cmp.getType();
----------------
lebedev.ri wrote:
> Why ConstantInt? What would be wrong with vector of integers? What about undef? Constant exprs?
Undefs are handled in other place (I will add tests showing that). 
Vectors of integers and floats should be fine, I'll add some tests on this.
Constant exprs -- not sure what you mean, but they should become constants at some point, shouldn't they?


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

https://reviews.llvm.org/D81151





More information about the llvm-commits mailing list