[llvm-commits] [llvm] r57833 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Duncan Sands baldrick at free.fr
Mon Oct 20 09:04:57 PDT 2008


Author: baldrick
Date: Mon Oct 20 11:04:57 2008
New Revision: 57833

URL: http://llvm.org/viewvc/llvm-project?rev=57833&view=rev
Log:
Don't use a random type for the select condition,
use an MVT::i1 and simplify the code while there.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=57833&r1=57832&r2=57833&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Mon Oct 20 11:04:57 2008
@@ -272,8 +272,7 @@
   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);
 }
 





More information about the llvm-commits mailing list