[llvm] [RISCV] Fix ReplaceNodeResults of Intrinsic::experimental_cttz_elts for RV32 (PR #174992)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 8 08:11:12 PST 2026
================
@@ -154,6 +154,23 @@ define i32 @ctz_nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %a) {
ret i32 %res
}
+define i64 @i64_ctz_nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %a) {
+; RV32-LABEL: i64_ctz_nxv16i1:
+; RV32: # %bb.0:
+; RV32-NEXT: vsetvli a0, zero, e8, m2, ta, ma
+; RV32-NEXT: vfirst.m a0, v8
+; RV32-NEXT: li a1, 0
+; RV32-NEXT: ret
+;
+; RV64-LABEL: i64_ctz_nxv16i1:
+; RV64: # %bb.0:
+; RV64-NEXT: vsetvli a0, zero, e8, m2, ta, ma
+; RV64-NEXT: vfirst.m a0, v8
+; RV64-NEXT: ret
+ %res = call i64 @llvm.experimental.cttz.elts.i32.nxv16i1(<vscale x 16 x i1> %a, i1 1)
----------------
topperc wrote:
This intrinsic is misnamed relative to its types. The i32 in the name should be i64.
https://github.com/llvm/llvm-project/pull/174992
More information about the llvm-commits
mailing list