From 3ed8b29acec3513d9338529c95e6cb3e4feb6b38 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Mon, 20 Oct 2008 16:04:57 +0000 Subject: Don't use a random type for the select condition, use an MVT::i1 and simplify the code while there. llvm-svn: 57833 --- llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index 588c24e8aa7..296aefc95d7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -272,8 +272,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_EXTRACT_VECTOR_ELT(SDNode *N) { if (TLI.isBigEndian()) std::swap(Lo, Hi); - SDValue Odd = DAG.getNode(ISD::AND, OldIdx.getValueType(), OldIdx, - DAG.getConstant(1, TLI.getShiftAmountTy())); + SDValue Odd = DAG.getNode(ISD::TRUNCATE, MVT::i1, OldIdx); return DAG.getNode(ISD::SELECT, NewVT, Odd, Hi, Lo); } -- cgit v1.2.3