Skip to content

Commit 9e45e7f

Browse files
committed
[RISCV][GISel] Remove unused isel patterns for s32 shifts with s64 shift amount.
The legalizer doesn't appear to create these.
1 parent a81902f commit 9e45e7f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/Target/RISCV/RISCVGISel.td

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ def : Pat<(XLenVT (sub GPR:$rs1, simm12Plus1:$imm)),
9595
let Predicates = [IsRV64] in {
9696
def : Pat<(i32 (sub GPR:$rs1, simm12Plus1i32:$imm)),
9797
(ADDIW GPR:$rs1, (i64 (NegImm $imm)))>;
98-
99-
def : Pat<(i32 (shl GPR:$rs1, (i32 GPR:$rs2))), (SLLW GPR:$rs1, GPR:$rs2)>;
100-
def : Pat<(i32 (sra GPR:$rs1, (i32 GPR:$rs2))), (SRAW GPR:$rs1, GPR:$rs2)>;
101-
def : Pat<(i32 (srl GPR:$rs1, (i32 GPR:$rs2))), (SRLW GPR:$rs1, GPR:$rs2)>;
10298
}
10399

104100
// Ptr type used in patterns with GlobalISelEmitter
@@ -195,9 +191,9 @@ def : PatGprGpr<sub, SUBW, i32, i32>;
195191
def : PatGprGpr<and, AND, i32, i32>;
196192
def : PatGprGpr<or, OR, i32, i32>;
197193
def : PatGprGpr<xor, XOR, i32, i32>;
198-
def : PatGprGpr<shiftopw<shl>, SLLW, i32, i64>;
199-
def : PatGprGpr<shiftopw<srl>, SRLW, i32, i64>;
200-
def : PatGprGpr<shiftopw<sra>, SRAW, i32, i64>;
194+
def : PatGprGpr<shl, SLLW, i32, i32>;
195+
def : PatGprGpr<srl, SRLW, i32, i32>;
196+
def : PatGprGpr<sra, SRAW, i32, i32>;
201197

202198
def : Pat<(i32 (add GPR:$rs1, simm12i32:$imm)),
203199
(ADDIW GPR:$rs1, (i64 (as_i64imm $imm)))>;

0 commit comments

Comments
 (0)