diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-10 21:01:08 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-10 21:01:08 +0000 |
commit | 940bafb687fdb6c3841b2d9f8f78cd543a7ccc95 (patch) | |
tree | 925dc8b16afd94e208352e89952d459676e2fa8d /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 7591130946662120b551be0b4d6977d88d9c0efe (diff) | |
download | bcm5719-llvm-940bafb687fdb6c3841b2d9f8f78cd543a7ccc95.tar.gz bcm5719-llvm-940bafb687fdb6c3841b2d9f8f78cd543a7ccc95.zip |
FastISel support for i1 constants.
llvm-svn: 56068
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 8a70b061873..13b1793e05c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/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); |