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

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 12:59:49 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:

I was thinking of the llvm/test/CodeGen/AArch64/lower-range-metadata-func-call.ll and llvm/test/CodeGen/AMDGPU/lower-range-metadata-intrinsic-call.ll that do not have a noundef metadata and still passes

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


More information about the llvm-commits mailing list