[PATCH] D99021: [RISCV] Add a special case to lowerSELECT for select of 2 constants with a SETLT condition.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 23 04:11:43 PDT 2021


frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1976
+    // is SETGE/SETLE to avoid an XORI.
+    if (isa<ConstantSDNode>(TrueV) && isa<ConstantSDNode>(FalseV) &&
+        CCVal == ISD::SETLT) {
----------------
I take it that this is guaranteed valid by `setBooleanContents(ZeroOrOneBooleanContent)`? If the cond was 0/-1 then we'd be in trouble.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99021



More information about the llvm-commits mailing list