[llvm] [RISCV] Optimize pattern `(setcc (selectLT (vfirst_vl ...) , 0, EVL, ...), EVL)` (PR #90538)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 03:00:21 PDT 2024


================
@@ -13670,6 +13671,14 @@ static bool narrowIndex(SDValue &N, ISD::MemIndexType IndexType, SelectionDAG &D
   return true;
 }
 
+// We're performing 2 combinations here:
+// === Rule 1 ===
+// Given VFirst = (vfirst_vl ..., EVL) and
+// (seteq (riscv_selectLT VFirst, 0, EVL, VFirst), EVL), we can replace it with
+// (setLT VFirst, 0). Similar replacements are done for variants w/ `setne` and
----------------
lukel97 wrote:

Is this pattern only generated by `RISCVTargetLowering::lowerVPCttzElements`? Would it be easier to just emit (setLT VFirst, 0) there

https://github.com/llvm/llvm-project/pull/90538


More information about the llvm-commits mailing list