forked from OSchip/llvm-project
Cannot create a result register for non-legal types.
llvm-svn: 143749
This commit is contained in:
parent
088789caa6
commit
5b8fdd7b62
|
@ -552,8 +552,9 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, EVT VT) {
|
||||||
// do so now.
|
// do so now.
|
||||||
const ConstantInt *CI = cast<ConstantInt>(C);
|
const ConstantInt *CI = cast<ConstantInt>(C);
|
||||||
if (Subtarget->hasV6T2Ops() && isUInt<16>(CI->getZExtValue())) {
|
if (Subtarget->hasV6T2Ops() && isUInt<16>(CI->getZExtValue())) {
|
||||||
|
EVT SrcVT = MVT::i32;
|
||||||
unsigned Opc = isThumb ? ARM::t2MOVi16 : ARM::MOVi16;
|
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,
|
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
|
||||||
TII.get(Opc), ImmReg)
|
TII.get(Opc), ImmReg)
|
||||||
.addImm(CI->getSExtValue()));
|
.addImm(CI->getSExtValue()));
|
||||||
|
|
Loading…
Reference in New Issue