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

Jonathan Roelofs via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 11:14:00 PST 2016


jroelofs added a subscriber: jroelofs.

================
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);
+
----------------
tstellarAMD wrote:
> 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?
Yes. I know of at least one out-of-tree target where this matters.


http://reviews.llvm.org/D15034





More information about the llvm-commits mailing list