[X86] X86InstrInfo.cpp - fix signed/unsigned promotion warnings in addImm calls

addImm takes a int64_t arg but we were using uint64_t types
This commit is contained in:
Simon Pilgrim 2022-06-15 18:20:00 +01:00
parent 45d88cd008
commit 4204361fed
1 changed files with 7 additions and 4 deletions

View File

@ -1186,8 +1186,11 @@ MachineInstr *X86InstrInfo::convertToThreeAddressWithLEA(unsigned MIOpc,
case X86::SHL8ri:
case X86::SHL16ri: {
unsigned ShAmt = MI.getOperand(2).getImm();
MIB.addReg(0).addImm(1ULL << ShAmt)
.addReg(InRegLEA, RegState::Kill).addImm(0).addReg(0);
MIB.addReg(0)
.addImm(1LL << ShAmt)
.addReg(InRegLEA, RegState::Kill)
.addImm(0)
.addReg(0);
break;
}
case X86::INC8r:
@ -1350,7 +1353,7 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr &MI,
NewMI = BuildMI(MF, MI.getDebugLoc(), get(X86::LEA64r))
.add(Dest)
.addReg(0)
.addImm(1ULL << ShAmt)
.addImm(1LL << ShAmt)
.add(Src)
.addImm(0)
.addReg(0);
@ -1374,7 +1377,7 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr &MI,
BuildMI(MF, MI.getDebugLoc(), get(Opc))
.add(Dest)
.addReg(0)
.addImm(1ULL << ShAmt)
.addImm(1LL << ShAmt)
.addReg(SrcReg, getKillRegState(isKill))
.addImm(0)
.addReg(0);