[PATCH] D159131: [RISCV][GlobalISel] Select G_ICMP

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 18:56:16 PDT 2023


craig.topper added a comment.

Need tests for comparing pointers to G_CONSTANT



================
Comment at: llvm/lib/Target/RISCV/RISCVGISel.td:98
+          (XORI (SLTIU GPR:$rs1,
+                       (ImmPlus1 simm12Minus1NonzeroNonNeg1:$imm)), 1)>;
----------------
craig.topper wrote:
> Need
> ```
> def : Pat<(XLenVT (setge (XLenVT GPR:$rs1), simm12:$imm)),
>           (XORI (SLTI GPR:$rs1, simm12:$imm), 1)>;
> def : Pat<(XLenVT (setuge (XLenVT GPR:$rs1), simm12:$imm)),
>           (XORI (SLTIU GPR:$rs1, simm12:$imm), 1)>;
> 
> def : Pat<(XLenVT (setle (XLenVT GPR:$rs1), simm12Minus1Nonzero:$imm)),
>          (SLTI GPR:$rs1, (ImmPlus1 simm12Minus1Nonzero:$imm))>;
> def : Pat<(XLenVT (setule (XLenVT GPR:$rs1), simm12Minus1NonzeroNonNeg1:$imm)),
>           (SLTIU GPR:$rs1,
>                        (ImmPlus1 simm12Minus1NonzeroNonNeg1:$imm))>;
> 
> ```
Still missing setle and setule patterns with immediates


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159131/new/

https://reviews.llvm.org/D159131



More information about the llvm-commits mailing list