aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-10 21:01:08 +0000
committerDan Gohman <gohman@apple.com>2008-09-10 21:01:08 +0000
commit805005db3515111884a4b5d5b804abdffb3aec99 (patch)
treed279ddc5521a0ec8da3bb9d682c5068819c59b50 /lib/CodeGen/SelectionDAG/FastISel.cpp
parentef89f2d17aef8e803bf454fdddea997cc79771dc (diff)
downloadexternal_llvm-805005db3515111884a4b5d5b804abdffb3aec99.zip
external_llvm-805005db3515111884a4b5d5b804abdffb3aec99.tar.gz
external_llvm-805005db3515111884a4b5d5b804abdffb3aec99.tar.bz2
FastISel support for i1 constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 8a70b06..13b1793 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -33,8 +33,16 @@ unsigned FastISel::getRegForValue(Value *V) {
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);