[PATCH] D14496: X86: More efficient codegen for 64-bit compares on 32-bit target

David Kreitzer via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 07:32:55 PST 2015


DavidKreitzer added inline comments.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:14593
@@ +14592,3 @@
+  assert(LHS.getSimpleValueType().isInteger() && "SETCCE is integer only.");
+  unsigned CC = TranslateX86CC(cast<CondCodeSDNode>(Cond)->get(), DL, false,
+                               LHS, RHS, DAG);
----------------
I like the idea of leveraging TranslateX86CC, but I believe these two optimizations at the beginning of TranslateX86CC are invalid for SETCCE and somehow need to be avoided for it:

        // X > -1   -> X == 0, jump !sign.
        // X < 0   -> X == 0, jump on sign.

They are invalid in the one special case where X is 0x80000000 and the carry is true. FWIW, this optimization *is* valid:

        // X < 1   -> X <= 0




http://reviews.llvm.org/D14496





More information about the llvm-commits mailing list