aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-01-01 15:52:00 +0000
committerDuncan Sands <baldrick@free.fr>2009-01-01 15:52:00 +0000
commit5480c0469e5c0323ffb12f1ead2abd169d6cc0e7 (patch)
tree1898f427b35c6795171701138e08762cd3aff3c1 /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent8fb520eb4f06d4ef771abe9c22d85b2a275988ee (diff)
downloadexternal_llvm-5480c0469e5c0323ffb12f1ead2abd169d6cc0e7.zip
external_llvm-5480c0469e5c0323ffb12f1ead2abd169d6cc0e7.tar.gz
external_llvm-5480c0469e5c0323ffb12f1ead2abd169d6cc0e7.tar.bz2
Fix PR3274: when promoting the condition of a BRCOND node,
promote from i1 all the way up to the canonical SetCC type. In order to discover an appropriate type to use, pass MVT::Other to getSetCCResultType. In order to be able to do this, change getSetCCResultType to take a type as an argument, not a value (this is also more logical). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index a321bed..3daa79e 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -1369,7 +1369,7 @@ void SelectionDAGLowering::visitJumpTableHeader(JumpTable &JT,
// Emit the range check for the jump table, and branch to the default block
// for the switch statement if the value being switched on exceeds the largest
// case in the switch.
- SDValue CMP = DAG.getSetCC(TLI.getSetCCResultType(SUB), SUB,
+ SDValue CMP = DAG.getSetCC(TLI.getSetCCResultType(SUB.getValueType()), SUB,
DAG.getConstant(JTH.Last-JTH.First,VT),
ISD::SETUGT);
@@ -1402,7 +1402,7 @@ void SelectionDAGLowering::visitBitTestHeader(BitTestBlock &B) {
DAG.getConstant(B.First, VT));
// Check range
- SDValue RangeCmp = DAG.getSetCC(TLI.getSetCCResultType(SUB), SUB,
+ SDValue RangeCmp = DAG.getSetCC(TLI.getSetCCResultType(SUB.getValueType()), SUB,
DAG.getConstant(B.Range, VT),
ISD::SETUGT);
@@ -1455,8 +1455,8 @@ void SelectionDAGLowering::visitBitTestCase(MachineBasicBlock* NextMBB,
SDValue AndOp = DAG.getNode(ISD::AND, TLI.getPointerTy(), SwitchVal,
DAG.getConstant(B.Mask, TLI.getPointerTy()));
- SDValue AndCmp = DAG.getSetCC(TLI.getSetCCResultType(AndOp), AndOp,
- DAG.getConstant(0, TLI.getPointerTy()),
+ SDValue AndCmp = DAG.getSetCC(TLI.getSetCCResultType(AndOp.getValueType()),
+ AndOp, DAG.getConstant(0, TLI.getPointerTy()),
ISD::SETNE);
CurMBB->addSuccessor(B.TargetBB);