Skip to content

Commit 9559de1

Browse files
[Target] Remove unnecessary casts (NFC) (llvm#151902)
getImm() already returns int64_t.
1 parent 76abef6 commit 9559de1

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ void SPIRVInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
375375
if (Op.isReg())
376376
O << '%' << (getIDFromRegister(Op.getReg().id()) + 1);
377377
else if (Op.isImm())
378-
O << formatImm((int64_t)Op.getImm());
378+
O << formatImm(Op.getImm());
379379
else if (Op.isDFPImm())
380380
O << formatImm((double)Op.getDFPImm());
381381
else if (Op.isExpr())

llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ MachineInstr *SystemZInstrInfo::foldMemoryOperandImpl(
12861286
if ((Opcode == SystemZ::ALFI && OpNum == 0 &&
12871287
isInt<8>((int32_t)MI.getOperand(2).getImm())) ||
12881288
(Opcode == SystemZ::ALGFI && OpNum == 0 &&
1289-
isInt<8>((int64_t)MI.getOperand(2).getImm()))) {
1289+
isInt<8>(MI.getOperand(2).getImm()))) {
12901290
// AL(G)FI %reg, CONST -> AL(G)SI %mem, CONST
12911291
Opcode = (Opcode == SystemZ::ALFI ? SystemZ::ALSI : SystemZ::ALGSI);
12921292
MachineInstr *BuiltMI =
@@ -1301,7 +1301,7 @@ MachineInstr *SystemZInstrInfo::foldMemoryOperandImpl(
13011301
if ((Opcode == SystemZ::SLFI && OpNum == 0 &&
13021302
isInt<8>((int32_t)-MI.getOperand(2).getImm())) ||
13031303
(Opcode == SystemZ::SLGFI && OpNum == 0 &&
1304-
isInt<8>((int64_t)-MI.getOperand(2).getImm()))) {
1304+
isInt<8>((-MI.getOperand(2).getImm())))) {
13051305
// SL(G)FI %reg, CONST -> AL(G)SI %mem, -CONST
13061306
Opcode = (Opcode == SystemZ::SLFI ? SystemZ::ALSI : SystemZ::ALGSI);
13071307
MachineInstr *BuiltMI =

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void WebAssemblyMCCodeEmitter::encodeInstruction(
107107
encodeULEB128(uint32_t(MO.getImm()), OS);
108108
break;
109109
case WebAssembly::OPERAND_I64IMM:
110-
encodeSLEB128(int64_t(MO.getImm()), OS);
110+
encodeSLEB128(MO.getImm(), OS);
111111
break;
112112
case WebAssembly::OPERAND_SIGNATURE:
113113
case WebAssembly::OPERAND_VEC_I8IMM:

llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ void X86IntelInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
369369
if (Op.isReg()) {
370370
printRegName(O, Op.getReg());
371371
} else if (Op.isImm()) {
372-
markup(O, Markup::Immediate) << formatImm((int64_t)Op.getImm());
372+
markup(O, Markup::Immediate) << formatImm(Op.getImm());
373373
} else {
374374
assert(Op.isExpr() && "unknown operand kind in printOperand");
375375
O << "offset ";

0 commit comments

Comments
 (0)