From: Chad Rosier Date: Fri, 4 Nov 2011 23:45:39 +0000 (+0000) Subject: Cannot create a result register for non-legal types. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=451afbc6a22a3a662eea7e86088c65c36e84949f;p=oota-llvm.git Cannot create a result register for non-legal types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143749 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp index a315c305fca..517f73f4e13 100644 --- a/lib/Target/ARM/ARMFastISel.cpp +++ b/lib/Target/ARM/ARMFastISel.cpp @@ -552,8 +552,9 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, EVT VT) { // do so now. const ConstantInt *CI = cast(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()));