From 555d8d6f4b0693309cd70efbf51b7abf804df5e4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 7 Dec 2006 22:36:47 +0000 Subject: [PATCH] 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 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index b8439a62bee..4b7c494781f 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); -- 2.34.1