Skip to content

Commit d0d0c4d

Browse files
committed
[RISCV] Use PatGprImm to simplify some isel patterns. NFC
1 parent ed5088a commit d0d0c4d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.td

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,14 +1909,10 @@ def : Pat<(binop_allwusers<srl> (sext_inreg GPR:$rs1, i32), uimm5:$shamt),
19091909
// SimplifyDemandedBits.
19101910
def : Pat<(binop_allwusers<and> GPR:$rs1, 0xffffffff),
19111911
(COPY GPR:$rs1)>;
1912-
def : Pat<(binop_allwusers<and> GPR:$rs1, u32simm12:$imm),
1913-
(ANDI GPR:$rs1, u32simm12:$imm)>;
1912+
def : PatGprImm<binop_allwusers<and>, ANDI, u32simm12>;
1913+
def : PatGprImm<binop_allwusers<or>, ORI, u32simm12>;
1914+
def : PatGprImm<binop_allwusers<xor>, XORI, u32simm12>;
19141915

1915-
def : Pat<(binop_allwusers<or> GPR:$rs1, u32simm12:$imm),
1916-
(ORI GPR:$rs1, u32simm12:$imm)>;
1917-
1918-
def : Pat<(binop_allwusers<xor> GPR:$rs1, u32simm12:$imm),
1919-
(XORI GPR:$rs1, u32simm12:$imm)>;
19201916
/// Loads
19211917

19221918
def : LdPat<sextloadi32, LW, i64>;

0 commit comments

Comments
 (0)