[PATCH] D27933: [InstCombine] fix operand-complexity-based canonicalization (PR28296)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 14:45:26 PST 2017


efriedma added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineInternal.h:54
   if (isa<Instruction>(V)) {
-    if (BinaryOperator::isNeg(V) || BinaryOperator::isFNeg(V) ||
-        BinaryOperator::isNot(V))
-      return 3;
-    return 4;
+    if (isa<UnaryInstruction>(V) || BinaryOperator::isNeg(V) ||
+        BinaryOperator::isFNeg(V) || BinaryOperator::isNot(V))
----------------
UnaryInstruction includes a lot of instructions, many of which are not really obvious; please enumerate the specific instructions you care about.

An explanation for why we want to use this ordering, as opposed to RPO order or something like that, would also be nice.


https://reviews.llvm.org/D27933





More information about the llvm-commits mailing list