[llvm] [SelectionDAG] Preserve CTTZ_ELTS lane count during expansion (PR #217982)

Oscar Priego via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 22 14:49:58 PDT 2026


================
@@ -101,5 +102,25 @@ define i8 @ctz_v8i16_poison(<8 x i16> %a) {
   ret i8 %res
 }
 
+define i32 @ctz_zero_v4i1() {
+; CHECK-LABEL: ctz_zero_v4i1:
+; CHECK:         movl $4, %eax
+; CHECK-NEXT:    retq
+; AVX512-LABEL: ctz_zero_v4i1:
+; AVX512:         addb $5, %al
+  %res = call i32 @llvm.experimental.cttz.elts.i32.v4i1(<4 x i1> zeroinitializer, i1 false)
----------------
Opriego wrote:

Addressed, thanks. I regenerated all CodeGen checks with update_llc_test_checks.py, restored the pre-existing constant-pool checks, and removed the autogenerated NOTE. The updated X86 test and the related cttz.elts tests pass locally.

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


More information about the llvm-commits mailing list