@@ -280,7 +280,8 @@ define amdgpu_kernel void @test_call_external_i1_zeroext_func_void() #0 {
280
280
; GCN-NEXT: $vgpr31 = COPY [[OR1]](s32)
281
281
; GCN-NEXT: $sgpr30_sgpr31 = G_SI_CALL [[GV]](p0), @external_i1_zeroext_func_void, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr31, implicit-def $vgpr0
282
282
; GCN-NEXT: [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr0
283
- ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY21]](s32)
283
+ ; GCN-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY21]], 1
284
+ ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ASSERT_ZEXT]](s32)
284
285
; GCN-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc
285
286
; GCN-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[TRUNC]](s1)
286
287
; GCN-NEXT: G_STORE [[ZEXT]](s32), [[DEF]](p1) :: (volatile store (s32) into `i32 addrspace(1)* undef`, addrspace 1)
@@ -341,7 +342,8 @@ define amdgpu_kernel void @test_call_external_i1_signext_func_void() #0 {
341
342
; GCN-NEXT: $vgpr31 = COPY [[OR1]](s32)
342
343
; GCN-NEXT: $sgpr30_sgpr31 = G_SI_CALL [[GV]](p0), @external_i1_signext_func_void, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr31, implicit-def $vgpr0
343
344
; GCN-NEXT: [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr0
344
- ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY21]](s32)
345
+ ; GCN-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY21]], 1
346
+ ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ASSERT_SEXT]](s32)
345
347
; GCN-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc
346
348
; GCN-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s1)
347
349
; GCN-NEXT: G_STORE [[SEXT]](s32), [[DEF]](p1) :: (volatile store (s32) into `i32 addrspace(1)* undef`, addrspace 1)
@@ -482,10 +484,10 @@ define amdgpu_kernel void @test_call_external_i8_zeroext_func_void() #0 {
482
484
; GCN-NEXT: $vgpr31 = COPY [[OR1]](s32)
483
485
; GCN-NEXT: $sgpr30_sgpr31 = G_SI_CALL [[GV]](p0), @external_i8_zeroext_func_void, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr31, implicit-def $vgpr0
484
486
; GCN-NEXT: [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr0
485
- ; GCN-NEXT: [[TRUNC :%[0-9]+]]:_(s16 ) = G_TRUNC [[COPY21]](s32)
486
- ; GCN-NEXT: [[TRUNC1 :%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC ]](s16 )
487
+ ; GCN-NEXT: [[ASSERT_ZEXT :%[0-9]+]]:_(s32 ) = G_ASSERT_ZEXT [[COPY21]], 8
488
+ ; GCN-NEXT: [[TRUNC :%[0-9]+]]:_(s8) = G_TRUNC [[ASSERT_ZEXT ]](s32 )
487
489
; GCN-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc
488
- ; GCN-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[TRUNC1 ]](s8)
490
+ ; GCN-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[TRUNC ]](s8)
489
491
; GCN-NEXT: G_STORE [[ZEXT]](s32), [[DEF]](p1) :: (volatile store (s32) into `i32 addrspace(1)* undef`, addrspace 1)
490
492
; GCN-NEXT: S_ENDPGM 0
491
493
%val = call i8 @external_i8_zeroext_func_void ()
@@ -544,10 +546,10 @@ define amdgpu_kernel void @test_call_external_i8_signext_func_void() #0 {
544
546
; GCN-NEXT: $vgpr31 = COPY [[OR1]](s32)
545
547
; GCN-NEXT: $sgpr30_sgpr31 = G_SI_CALL [[GV]](p0), @external_i8_signext_func_void, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr31, implicit-def $vgpr0
546
548
; GCN-NEXT: [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr0
547
- ; GCN-NEXT: [[TRUNC :%[0-9]+]]:_(s16 ) = G_TRUNC [[COPY21]](s32)
548
- ; GCN-NEXT: [[TRUNC1 :%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC ]](s16 )
549
+ ; GCN-NEXT: [[ASSERT_SEXT :%[0-9]+]]:_(s32 ) = G_ASSERT_SEXT [[COPY21]], 8
550
+ ; GCN-NEXT: [[TRUNC :%[0-9]+]]:_(s8) = G_TRUNC [[ASSERT_SEXT ]](s32 )
549
551
; GCN-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc
550
- ; GCN-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC1 ]](s8)
552
+ ; GCN-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC ]](s8)
551
553
; GCN-NEXT: G_STORE [[SEXT]](s32), [[DEF]](p1) :: (volatile store (s32) into `i32 addrspace(1)* undef`, addrspace 1)
552
554
; GCN-NEXT: S_ENDPGM 0
553
555
%val = call i8 @external_i8_signext_func_void ()
@@ -665,7 +667,8 @@ define amdgpu_kernel void @test_call_external_i16_zeroext_func_void() #0 {
665
667
; GCN-NEXT: $vgpr31 = COPY [[OR1]](s32)
666
668
; GCN-NEXT: $sgpr30_sgpr31 = G_SI_CALL [[GV]](p0), @external_i16_zeroext_func_void, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr31, implicit-def $vgpr0
667
669
; GCN-NEXT: [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr0
668
- ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY21]](s32)
670
+ ; GCN-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY21]], 16
671
+ ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ASSERT_ZEXT]](s32)
669
672
; GCN-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc
670
673
; GCN-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[TRUNC]](s16)
671
674
; GCN-NEXT: G_STORE [[ZEXT]](s32), [[DEF]](p1) :: (volatile store (s32) into `i32 addrspace(1)* undef`, addrspace 1)
@@ -726,7 +729,8 @@ define amdgpu_kernel void @test_call_external_i16_signext_func_void() #0 {
726
729
; GCN-NEXT: $vgpr31 = COPY [[OR1]](s32)
727
730
; GCN-NEXT: $sgpr30_sgpr31 = G_SI_CALL [[GV]](p0), @external_i16_signext_func_void, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr31, implicit-def $vgpr0
728
731
; GCN-NEXT: [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr0
729
- ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY21]](s32)
732
+ ; GCN-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY21]], 16
733
+ ; GCN-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ASSERT_SEXT]](s32)
730
734
; GCN-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc
731
735
; GCN-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16)
732
736
; GCN-NEXT: G_STORE [[SEXT]](s32), [[DEF]](p1) :: (volatile store (s32) into `i32 addrspace(1)* undef`, addrspace 1)
0 commit comments