1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
2
- ; RUN: llc -mtriple=amdgcn-amd-amdpal -stop-after=amdgpu-isel < %s | FileCheck -check-prefixes=GCN-ISEL %s
2
+ ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 - stop-after=amdgpu-isel < %s | FileCheck -check-prefixes=GCN-ISEL %s
3
3
; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 < %s | FileCheck %s
4
4
; Ensure that S_UADDO_PSEUDO is selected when carryout user is S_ADD_CO_PSEUDO
5
5
@@ -22,5 +22,25 @@ define amdgpu_ps i32 @s_uaddo_pseudo(i32 inreg %val0) {
22
22
%result = add i32 %zext_carryout , 1
23
23
ret i32 %result
24
24
}
25
+
26
+ ; GCN-ISEL-LABEL: name: s_usubo_pseudo
27
+ ; GCN-ISEL-LABEL: body:
28
+ ; GCN-ISEL: S_USUBO_PSEUDO
29
+ ; GCN-ISEL: S_SUB_CO_PSEUDO
30
+
31
+ define amdgpu_ps i32 @s_usubo_pseudo (i32 inreg %val0 , i32 inreg %val1 ) {
32
+ ; CHECK-LABEL: s_usubo_pseudo:
33
+ ; CHECK: ; %bb.0:
34
+ ; CHECK-NEXT: s_sub_u32 s0, s0, 1
35
+ ; CHECK-NEXT: s_cselect_b64 s[2:3], -1, 0
36
+ ; CHECK-NEXT: s_cmp_lg_u64 s[2:3], 0
37
+ ; CHECK-NEXT: s_subb_u32 s0, s1, 0
38
+ ; CHECK-NEXT: ; return to shader part epilog
39
+ %pair = call { i32 , i1 } @llvm.usub.with.overflow.i32 (i32 %val0 , i32 1 )
40
+ %carryout = extractvalue { i32 , i1 } %pair , 1
41
+ %zext_carryout = zext i1 %carryout to i32
42
+ %result = sub i32 %val1 , %zext_carryout
43
+ ret i32 %result
44
+ }
25
45
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
26
46
; GCN-ISEL: {{.*}}
0 commit comments