Skip to content

Commit ad9d551

Browse files
authored
[Mips] Remove size operand of LwRxPcTcp16 / LwRxPcTcpX16 (#157348)
There is no such operand on LW instructions. It is neither encoded nor printed, and was only inserted by MipsConstantIslands pass but never used after that.
1 parent 0bbf2ea commit ad9d551

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Target/Mips/Mips16InstrInfo.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class FRI16_ins<bits<5> op, string asmstr,
8888

8989
class FRI16_TCP_ins<bits<5> _op, string asmstr,
9090
InstrItinClass itin>:
91-
FRI16<_op, (outs CPU16Regs:$rx), (ins pcrel16:$imm8, i32imm:$size),
91+
FRI16<_op, (outs CPU16Regs:$rx), (ins pcrel16:$imm8),
9292
!strconcat(asmstr, "\t$rx, $imm8\t# 16 bit inst"), [], itin>;
9393

9494
class FRI16R_ins_base<bits<5> op, string asmstr, string asmstr2,
@@ -216,7 +216,7 @@ class FEXT_RI16_B_ins<bits<5> _op, string asmstr,
216216

217217
class FEXT_RI16_TCP_ins<bits<5> _op, string asmstr,
218218
InstrItinClass itin>:
219-
FEXT_RI16<_op, (outs CPU16Regs:$rx), (ins pcrel16:$imm16, i32imm:$size),
219+
FEXT_RI16<_op, (outs CPU16Regs:$rx), (ins pcrel16:$imm16),
220220
!strconcat(asmstr, "\t$rx, $imm16"), [], itin>;
221221

222222
class FEXT_2RI16_ins<bits<5> _op, string asmstr,
@@ -856,6 +856,7 @@ def LwRxSpImmX16: FEXT_RRI16_mem_ins<0b10010, "lw", mem16sp, II_LW>, MayLoad;
856856
def LwRxPcTcp16: FRI16_TCP_ins<0b10110, "lw", II_LW>, MayLoad;
857857

858858
def LwRxPcTcpX16: FEXT_RI16_TCP_ins<0b10110, "lw", II_LW>, MayLoad;
859+
859860
//
860861
// Format: MOVE r32, rz MIPS16e
861862
// Purpose: Move

llvm/lib/Target/Mips/MipsConstantIslandPass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,6 @@ void MipsConstantIslands::prescanForConstants() {
16471647
MI.removeOperand(1);
16481648
MI.removeOperand(1);
16491649
MI.addOperand(MachineOperand::CreateCPI(index, 0));
1650-
MI.addOperand(MachineOperand::CreateImm(4));
16511650
}
16521651
break;
16531652
}

0 commit comments

Comments
 (0)