[PATCH] D153502: [DAGCombiner] Change foldAndOrOfSETCC() to optimize and/or patterns

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 23:15:42 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/test/CodeGen/RISCV/zbb-cmp-combine.ll:51-52
 ; CHECK:       # %bb.0:
-; CHECK-NEXT:    minu a1, a1, a2
-; CHECK-NEXT:    sltu a0, a1, a0
+; CHECK-NEXT:    maxu a1, a1, a2
+; CHECK-NEXT:    sltu a0, a0, a1
 ; CHECK-NEXT:    ret
----------------
kmitropoulou wrote:
> foad wrote:
> > - RISCV was already doing this optimization - where?
> > - Your result is different - it uses maxu instead of minu. One of them must be wrong.
> @Ilya Andreev: How is this optimization done in RISCV?
> 
> I fixed the bug. 
The RISC-V code in `combineCmpOp` in RISCVISelLowering.cpp


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153502



More information about the llvm-commits mailing list