[llvm] [VP][RISCV] Add vp.cttz.elts intrinsic and its RISC-V codegen (PR #90502)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 11:54:21 PDT 2024


================
@@ -9074,6 +9074,38 @@ SDValue TargetLowering::expandVPCTTZ(SDNode *Node, SelectionDAG &DAG) const {
   return DAG.getNode(ISD::VP_CTPOP, dl, VT, Tmp, Mask, VL);
 }
 
+SDValue TargetLowering::expandVPCTTZElements(SDNode *N,
+                                             SelectionDAG &DAG) const {
+  // %cond = to_bool_vec %source
+  // %splat = splat /*val=*/VL
+  // %tz = step_vector
+  // %v = vp.select %cond, /*true=*/tz, /*false=*/%splat
+  // %r = vp.reduce.umin %v
----------------
topperc wrote:

let me look at again. I think I thought about it wrong.

Is there an opportunity to simplify the fall back code in SelectionDAGBuilder for experimental.cttz.elts. It uses umax.

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


More information about the llvm-commits mailing list