[PATCH] D94535: [RISCV] Optimize Branch Comparisons

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 11:44:41 PST 2021


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:969
 
 // An extra pattern is needed for a brcond without a setcc (i.e. where the
 // condition was calculated elsewhere).
----------------
Needs to be plural now


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:972
 def : Pat<(brcond GPR:$cond, bb:$imm12), (BNE GPR:$cond, X0, bb:$imm12)>;
+def : Pat<(brcond (XLenVT (xor GPR:$cond, 1)), bb:$imm12),
+          (BEQ GPR:$cond, X0, bb:$imm12)>;
----------------
Hmm, it's a shame `not` is an alias for `(xor $arg, -1)`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94535



More information about the llvm-commits mailing list