[PATCH] Fix optimisations of SELECT_CC which assumed result is boolean

Matt Arsenault Matthew.Arsenault at amd.com
Thu Nov 13 14:03:38 PST 2014


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3833
@@ -3828,4 +3832,3 @@
   // fold !(x cc y) -> (x !cc y)
-  if (N1C && N1C->getAPIntValue().isAllOnesValue() &&
-      isSetCCEquivalent(N0, LHS, RHS, CC)) {
+  if (N1C && N1C->getAPIntValue() == 1 && isSetCCEquivalent(N0, LHS, RHS, CC)) {
     bool isInt = LHS.getValueType().isInteger();
----------------
t.p.northover wrote:
> I think this should use isConstTrueVal instead of hard-coding either 1 or AllOnes.
Agree

http://reviews.llvm.org/D6249






More information about the llvm-commits mailing list