[llvm] [SDAG] Lower range attribute to AssertZext (PR #95450)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 12:35:22 PDT 2024


================
@@ -34,6 +34,24 @@ define i64 @widen_assertzext(ptr %x) nounwind {
   ret i64 %d
 }
 
+define i64 @widen_assertzext_range_attr(ptr %x) nounwind {
+; CHECK-LABEL: widen_assertzext_range_attr:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    pushq %rax
+; CHECK-NEXT:    callq test2 at PLT
+; CHECK-NEXT:    movb $127, %al
+; CHECK-NEXT:    kmovw %eax, %k1
+; CHECK-NEXT:    vpexpandq %zmm0, %zmm0 {%k1} {z}
+; CHECK-NEXT:    vextracti32x4 $3, %zmm0, %xmm0
+; CHECK-NEXT:    vmovq %xmm0, %rax
+; CHECK-NEXT:    popq %rcx
+; CHECK-NEXT:    vzeroupper
+; CHECK-NEXT:    retq
+  %e = call noundef range(i64 0, 2) <7 x i64> @test2()
+  %d = extractelement <7 x i64> %e, i32 6
+  ret i64 %d
+}
+
----------------
andjo403 wrote:

hmm the test that was added originally added in https://github.com/llvm/llvm-project/commit/2bba779272a23094b3a1ff7b3c56259d51f457df for this seems to have not failed when the noundef check was added in https://github.com/llvm/llvm-project/commit/9deee6bffa9c331f46c68e5dd4cb4abf93dc0716 shall I add noundef to those test and also use the update_llc_test_checks?
and then add the requested tests?

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


More information about the llvm-commits mailing list