diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index d73bce74e6b..912dc322ff2 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -33,14 +33,14 @@ unsigned FastISel::getRegForValue(Value *V) { return Reg; MVT::SimpleValueType VT = TLI.getValueType(V->getType()).getSimpleVT(); + if (!TLI.isTypeLegal(VT)) + return 0; if (ConstantInt *CI = dyn_cast(V)) { if (CI->getValue().getActiveBits() > 64) return TargetMaterializeConstant(CI, MBB->getParent()->getConstantPool()); // Don't cache constant materializations. To do so would require // tracking what uses they dominate. - if (!TLI.isTypeLegal(VT)) - return false; Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue()); } else if (isa(V)) { return TargetMaterializeConstant(dyn_cast(V),