Skip to content

Commit

Permalink
[RISCV] Replace a custom SDTypeProfile with SDTIntBinOp which should …
Browse files Browse the repository at this point in the history
…be sufficient here.

On the surface this would be slightly less optimal for the isel
table, but due to a tablegen issue with HW mode this ends up
generating a smaller isel table.
  • Loading branch information
topperc committed Dec 6, 2020
1 parent b00f345 commit 5fc8f90
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions llvm/lib/Target/RISCV/RISCVInstrInfoB.td
Expand Up @@ -716,13 +716,10 @@ let Predicates = [HasStdExtZbs] in
def : Pat<(and (srl GPR:$rs1, uimmlog2xlen:$shamt), (XLenVT 1)),
(SBEXTI GPR:$rs1, uimmlog2xlen:$shamt)>;

def SDT_RISCVGREVGORC : SDTypeProfile<1, 2, [SDTCisVT<0, XLenVT>,
SDTCisSameAs<0, 1>,
SDTCisSameAs<1, 2>]>;
def riscv_grevi : SDNode<"RISCVISD::GREVI", SDT_RISCVGREVGORC, []>;
def riscv_greviw : SDNode<"RISCVISD::GREVIW", SDT_RISCVGREVGORC, []>;
def riscv_gorci : SDNode<"RISCVISD::GORCI", SDT_RISCVGREVGORC, []>;
def riscv_gorciw : SDNode<"RISCVISD::GORCIW", SDT_RISCVGREVGORC, []>;
def riscv_grevi : SDNode<"RISCVISD::GREVI", SDTIntBinOp, []>;
def riscv_greviw : SDNode<"RISCVISD::GREVIW", SDTIntBinOp, []>;
def riscv_gorci : SDNode<"RISCVISD::GORCI", SDTIntBinOp, []>;
def riscv_gorciw : SDNode<"RISCVISD::GORCIW", SDTIntBinOp, []>;

let Predicates = [HasStdExtZbp] in {
def : Pat<(riscv_grevi GPR:$rs1, timm:$shamt), (GREVI GPR:$rs1, timm:$shamt)>;
Expand Down

0 comments on commit 5fc8f90

Please sign in to comment.