Cannot create a result register for non-legal types.

llvm-svn: 143749
This commit is contained in:
Chad Rosier 2011-11-04 23:45:39 +00:00
parent 088789caa6
commit 5b8fdd7b62
1 changed files with 2 additions and 1 deletions

View File

@ -552,8 +552,9 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, EVT VT) {
// do so now.
const ConstantInt *CI = cast<ConstantInt>(C);
if (Subtarget->hasV6T2Ops() && isUInt<16>(CI->getZExtValue())) {
EVT SrcVT = MVT::i32;
unsigned Opc = isThumb ? ARM::t2MOVi16 : ARM::MOVi16;
unsigned ImmReg = createResultReg(TLI.getRegClassFor(VT));
unsigned ImmReg = createResultReg(TLI.getRegClassFor(SrcVT));
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(Opc), ImmReg)
.addImm(CI->getSExtValue()));