[PATCH] D15034: TargetLowering: Improve handling of (setcc ([sz]ext x) 0, cc) in SimplifySetCC

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 09:57:48 PST 2016


tstellarAMD added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:1394-1398
@@ +1393,7 @@
+                                    N0Opc == ISD::SIGN_EXTEND)) ||
+            (N1C->isOne() && N0Opc == ISD::ZERO_EXTEND) ||
+            (N1C->isAllOnesValue() && N0Opc == ISD::SIGN_EXTEND))) {
+
+          bool Inverse = (N1C->isNullValue() && Cond == ISD::SETEQ) ||
+                         (!N1C->isNullValue() && Cond == ISD::SETNE);
+
----------------
arsenm wrote:
> I think you should use TLI::isConstTrueVal/isConstFalseVal so this only happens if the correct BooleanContents is used
Do you think this is still necessary since we are only looking at i1 setcc operations?


http://reviews.llvm.org/D15034





More information about the llvm-commits mailing list