Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit c76c3fe

Browse files
committed
[FastISel][ARM] Fix a bug in the integer materialization code.
getRegClassFor returns the incorrect register class when in Thumb2 mode. This fix simply manually selects the register class as in the code just a few lines above. There is no test case for this code, because the code is currently unreachable. This will be changed in a future commit and existing test cases will exercise this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215583 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent eac0bae commit c76c3fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Target/ARM/ARMFastISel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,9 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, MVT VT) {
536536
(ARM_AM::getSOImmVal(Imm) != -1);
537537
if (UseImm) {
538538
unsigned Opc = isThumb2 ? ARM::t2MVNi : ARM::MVNi;
539-
unsigned ImmReg = createResultReg(TLI.getRegClassFor(MVT::i32));
539+
const TargetRegisterClass *RC = isThumb2 ? &ARM::rGPRRegClass :
540+
&ARM::GPRRegClass;
541+
unsigned ImmReg = createResultReg(RC);
540542
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
541543
TII.get(Opc), ImmReg)
542544
.addImm(Imm));

0 commit comments

Comments
 (0)