aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-12-07 22:36:47 +0000
committerChris Lattner <sabre@nondot.org>2006-12-07 22:36:47 +0000
commit555d8d6f4b0693309cd70efbf51b7abf804df5e4 (patch)
tree8373cb80d53a0917236c69f10fc654dfa27e78b6
parentd4fca27e5953e89ea000253998ffcd93ae74e5cc (diff)
downloadexternal_llvm-555d8d6f4b0693309cd70efbf51b7abf804df5e4.zip
external_llvm-555d8d6f4b0693309cd70efbf51b7abf804df5e4.tar.gz
external_llvm-555d8d6f4b0693309cd70efbf51b7abf804df5e4.tar.bz2
Fix CodeGen/PowerPC/2006-12-07-SelectCrash.ll on PPC64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32336 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index b8439a6..4b7c494 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3755,7 +3755,10 @@ SDOperand DAGCombiner::SimplifySelectCC(SDOperand N0, SDOperand N1,
// cast from setcc result type to select result type
if (AfterLegalize) {
SCC = DAG.getSetCC(TLI.getSetCCResultTy(), N0, N1, CC);
- Temp = DAG.getZeroExtendInReg(SCC, N2.getValueType());
+ if (N2.getValueType() < SCC.getValueType())
+ Temp = DAG.getZeroExtendInReg(SCC, N2.getValueType());
+ else
+ Temp = DAG.getNode(ISD::ZERO_EXTEND, N2.getValueType(), SCC);
} else {
SCC = DAG.getSetCC(MVT::i1, N0, N1, CC);
Temp = DAG.getNode(ISD::ZERO_EXTEND, N2.getValueType(), SCC);