[PATCH] D98449: [RISCV] Add isel-patterns to optimize (a < 1) and (a > -1) into bge

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 12:54:58 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1001
 
+// Lower (a > -1) to (a >= 0) and (a < 1) to (0 >= a).
+def : Pat<(brcond (XLenVT (setlt XLenVT:$lhs, 1)), bb:$dst),
----------------
We already have this in this exact spot in the file. Is your repo out of date?

```
// Match X > -1, the canonical form of X >= 0, to the bgez pattern.                                                                                                                                                                                                                                                                                                                                                                                                      
def : Pat<(brcond (XLenVT (setgt GPR:$rs1, -1)), bb:$imm12),                                                                                                                                                                                                                                                                                                                                                                                                             
          (BGE GPR:$rs1, X0, bb:$imm12)>; 
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98449



More information about the llvm-commits mailing list