[llvm-commits] [llvm] r56068 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Dan Gohman
gohman at apple.com
Wed Sep 10 14:01:08 PDT 2008
Author: djg
Date: Wed Sep 10 16:01:08 2008
New Revision: 56068
URL: http://llvm.org/viewvc/llvm-project?rev=56068&view=rev
Log:
FastISel support for i1 constants.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=56068&r1=56067&r2=56068&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Sep 10 16:01:08 2008
@@ -33,8 +33,16 @@
return Reg;
MVT::SimpleValueType VT = TLI.getValueType(V->getType()).getSimpleVT();
- if (!TLI.isTypeLegal(VT))
- return 0;
+
+ // Ignore illegal types.
+ if (!TLI.isTypeLegal(VT)) {
+ // Promote MVT::i1 to a legal type though, because it's common and easy.
+ if (VT == MVT::i1)
+ VT = TLI.getTypeToTransformTo(VT).getSimpleVT();
+ else
+ return 0;
+ }
+
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
if (CI->getValue().getActiveBits() > 64)
return TargetMaterializeConstant(CI);
More information about the llvm-commits
mailing list