Skip to content

Commit

Permalink
[RISCV] Use replace XLenVT with i64 in some isel patterns that are on…
Browse files Browse the repository at this point in the history
…ly used for RV64. NFC
  • Loading branch information
topperc committed Feb 9, 2024
1 parent 763139a commit b2cd50d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
Original file line number Diff line number Diff line change
Expand Up @@ -888,22 +888,22 @@ foreach i = {1,2,3} in {
}

let Predicates = [HasStdExtZbs, IsRV64] in {
def : Pat<(i32 (and (not (shiftop<shl> 1, (XLenVT GPR:$rs2))), GPR:$rs1)),
def : Pat<(i32 (and (not (shiftop<shl> 1, (i64 GPR:$rs2))), GPR:$rs1)),
(BCLR GPR:$rs1, GPR:$rs2)>;
def : Pat<(i32 (and (rotl -2, (XLenVT GPR:$rs2)), GPR:$rs1)),
def : Pat<(i32 (and (rotl -2, (i64 GPR:$rs2)), GPR:$rs1)),
(BCLR GPR:$rs1, GPR:$rs2)>;
def : Pat<(i32 (or (shiftop<shl> 1, (XLenVT GPR:$rs2)), GPR:$rs1)),
def : Pat<(i32 (or (shiftop<shl> 1, (i64 GPR:$rs2)), GPR:$rs1)),
(BSET GPR:$rs1, GPR:$rs2)>;
def : Pat<(i32 (xor (shiftop<shl> 1, (XLenVT GPR:$rs2)), GPR:$rs1)),
def : Pat<(i32 (xor (shiftop<shl> 1, (i64 GPR:$rs2)), GPR:$rs1)),
(BINV GPR:$rs1, GPR:$rs2)>;
def : Pat<(i32 (and (shiftop<srl> GPR:$rs1, (XLenVT GPR:$rs2)), 1)),
def : Pat<(i32 (and (shiftop<srl> GPR:$rs1, (i64 GPR:$rs2)), 1)),
(BEXT GPR:$rs1, GPR:$rs2)>;
def : Pat<(i64 (and (anyext (i32 (shiftop<srl> GPR:$rs1, (XLenVT GPR:$rs2)))), 1)),
def : Pat<(i64 (and (anyext (i32 (shiftop<srl> GPR:$rs1, (i64 GPR:$rs2)))), 1)),
(BEXT GPR:$rs1, GPR:$rs2)>;

def : Pat<(i32 (shiftop<shl> 1, (XLenVT GPR:$rs2))),
def : Pat<(i32 (shiftop<shl> 1, (i64 GPR:$rs2))),
(BSET (XLenVT X0), GPR:$rs2)>;
def : Pat<(i32 (not (shiftop<shl> -1, (XLenVT GPR:$rs2)))),
def : Pat<(i32 (not (shiftop<shl> -1, (i64 GPR:$rs2)))),
(ADDI (BSET (XLenVT X0), GPR:$rs2), -1)>;

def : Pat<(i32 (and (srl GPR:$rs1, uimm5:$shamt), (i32 1))),
Expand Down

0 comments on commit b2cd50d

Please sign in to comment.