[PATCH] D26525: [InstCombine] canonicalize min/max constant to select's false value

Ayal Zaks via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 08:19:11 PST 2016


Ayal added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:515-516
+                               InstCombiner::BuilderTy &Builder) {
+  // TODO: We should also canonicalize min/max when the select has a different
+  // constant value than the cmp constant, but we need to fix the backend first.
+  if (!Cmp.hasOneUse() || !isa<Constant>(Cmp.getOperand(1)) ||
----------------
When the constant value of the select differs from that of the cmp, is it still considered min/max?


https://reviews.llvm.org/D26525





More information about the llvm-commits mailing list