@@ -66,8 +66,8 @@ static void emitThumb1LoadConstPool(MachineBasicBlock &MBB,
6666 const ARMSubtarget &STI = MF.getSubtarget <ARMSubtarget>();
6767 const TargetInstrInfo &TII = *STI.getInstrInfo ();
6868 MachineConstantPool *ConstantPool = MF.getConstantPool ();
69- const Constant *C = ConstantInt::get (
70- Type::getInt32Ty (MBB.getParent ()->getFunction ().getContext ()), Val);
69+ const Constant *C = ConstantInt::getSigned (
70+ Type::getInt32Ty (MBB.getParent ()->getFunction ().getContext ()), Val);
7171 unsigned Idx = ConstantPool->getConstantPoolIndex (C, Align (4 ));
7272
7373 BuildMI (MBB, MBBI, dl, TII.get (ARM::tLDRpci))
@@ -85,8 +85,8 @@ static void emitThumb2LoadConstPool(MachineBasicBlock &MBB,
8585 MachineFunction &MF = *MBB.getParent ();
8686 const TargetInstrInfo &TII = *MF.getSubtarget ().getInstrInfo ();
8787 MachineConstantPool *ConstantPool = MF.getConstantPool ();
88- const Constant *C = ConstantInt::get (
89- Type::getInt32Ty (MBB.getParent ()->getFunction ().getContext ()), Val);
88+ const Constant *C = ConstantInt::getSigned (
89+ Type::getInt32Ty (MBB.getParent ()->getFunction ().getContext ()), Val);
9090 unsigned Idx = ConstantPool->getConstantPoolIndex (C, Align (4 ));
9191
9292 BuildMI (MBB, MBBI, dl, TII.get (ARM::t2LDRpci))
0 commit comments