A use by operand 1 or 2 of a SELECT is not a FLAGS use. This
authorDan Gohman <gohman@apple.com>
Mon, 4 Jan 2010 20:52:50 +0000 (20:52 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 4 Jan 2010 20:52:50 +0000 (20:52 +0000)
lets the test-elimination work in more conditional-move cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92508 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index c722fbf648b410192944f7856bc737eef4511f80..ef98a2cbf5c5573ef6516780ff3e81c0067af7a8 100644 (file)
@@ -5612,7 +5612,7 @@ SDValue X86TargetLowering::EmitTest(SDValue Op, unsigned X86CC,
       for (SDNode::use_iterator UI = Op.getNode()->use_begin(),
            UE = Op.getNode()->use_end(); UI != UE; ++UI)
         if (UI->getOpcode() != ISD::BRCOND &&
-            UI->getOpcode() != ISD::SELECT &&
+            (UI->getOpcode() != ISD::SELECT || UI.getOperandNo() != 0) &&
             UI->getOpcode() != ISD::SETCC) {
           NonFlagUse = true;
           break;