[PATCH] D137949: [RISCV] Branchless lowering for (select (x < 0), TrueConstant, FalseConstant) and (select (x >= 0), TrueConstant, FalseConstant)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 17:41:45 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:9652
+      }
+      std::swap(TrueSImm, FalseSImm);
+    }
----------------
liaolucy wrote:
> reames wrote:
> > craig.topper wrote:
> > > Was this supposed to be TrueV and FalseV?
> > That's what I read it as... good catch!
> Sorry, I've been a bit confused lately.
I think this swap needs to only happen if you did the first swap. So you need to check CCVal is SETGE again


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137949



More information about the llvm-commits mailing list