[PATCH] Allow setcc (sext setcc) [0|1] [eq|ne] -> setcc

Matt Arsenault Matthew.Arsenault at amd.com
Wed Jul 23 13:44:53 PDT 2014


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:1496
@@ +1495,3 @@
+          return Ret;
+      } else if (N0.getOpcode() == ISD::SIGN_EXTEND) {
+        // setcc (sext (setcc)), [0|1], [eq|ne]  -> setcc
----------------
Chandler Carruth wrote:
> Why only sign_extend? if zext or anyext can't happen here, it seems worth a comment.
zext doesn't need to be handled because there is already a combine for  (zext x) == C --> x == (trunc C). I'm not sure why that doesn't work for sext.

http://reviews.llvm.org/D4600






More information about the llvm-commits mailing list