@@ -61,7 +61,6 @@ void test_signed_lwat(int *ptr, int value, int * resp) {
6161 * resp = res ;
6262}
6363
64-
6564// CHECK-LABEL: define dso_local void @test_signed_ldat(
6665// CHECK-SAME: ptr noundef [[PTR:%.*]], i64 noundef [[VALUE:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
6766// CHECK-NEXT: [[ENTRY:.*:]]
@@ -81,6 +80,82 @@ void test_signed_ldat(long int *ptr, long int value, long int * resp) {
8180 * resp = res ;
8281}
8382
83+ // CHECK-LABEL: define dso_local void @test_unsigned_lwat_cond(
84+ // CHECK-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
85+ // CHECK-NEXT: [[ENTRY:.*:]]
86+ // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.ppc.amo.lwat.cond(ptr [[PTR]], i32 24)
87+ // CHECK-NEXT: store i32 [[TMP0]], ptr [[RESP]], align 4, !tbaa [[INT_TBAA2]]
88+ // CHECK-NEXT: ret void
89+ //
90+ // AIX-LABEL: define void @test_unsigned_lwat_cond(
91+ // AIX-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
92+ // AIX-NEXT: [[ENTRY:.*:]]
93+ // AIX-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.ppc.amo.lwat.cond(ptr [[PTR]], i32 24)
94+ // AIX-NEXT: store i32 [[TMP0]], ptr [[RESP]], align 4, !tbaa [[INT_TBAA2]]
95+ // AIX-NEXT: ret void
96+ //
97+ void test_unsigned_lwat_cond (unsigned int * ptr , unsigned int * resp ) {
98+ unsigned int res = __builtin_amo_lwat_cond (ptr , 24 );
99+ * resp = res ;
100+ }
101+
102+ // CHECK-LABEL: define dso_local void @test_unsigned_ldat_cond(
103+ // CHECK-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
104+ // CHECK-NEXT: [[ENTRY:.*:]]
105+ // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.ppc.amo.ldat.cond(ptr [[PTR]], i32 25)
106+ // CHECK-NEXT: store i64 [[TMP0]], ptr [[RESP]], align 8, !tbaa [[LONG_TBAA6]]
107+ // CHECK-NEXT: ret void
108+ //
109+ // AIX-LABEL: define void @test_unsigned_ldat_cond(
110+ // AIX-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
111+ // AIX-NEXT: [[ENTRY:.*:]]
112+ // AIX-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.ppc.amo.ldat.cond(ptr [[PTR]], i32 25)
113+ // AIX-NEXT: store i64 [[TMP0]], ptr [[RESP]], align 8, !tbaa [[LONG_TBAA6]]
114+ // AIX-NEXT: ret void
115+ //
116+ void test_unsigned_ldat_cond (unsigned long int * ptr , unsigned long int * resp ) {
117+ unsigned long int res = __builtin_amo_ldat_cond (ptr , 25 );
118+ * resp = res ;
119+ }
120+
121+ // CHECK-LABEL: define dso_local void @test_signed_lwat_cond(
122+ // CHECK-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
123+ // CHECK-NEXT: [[ENTRY:.*:]]
124+ // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.ppc.amo.lwat.cond(ptr [[PTR]], i32 24)
125+ // CHECK-NEXT: store i32 [[TMP0]], ptr [[RESP]], align 4, !tbaa [[INT_TBAA2]]
126+ // CHECK-NEXT: ret void
127+ //
128+ // AIX-LABEL: define void @test_signed_lwat_cond(
129+ // AIX-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 4)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
130+ // AIX-NEXT: [[ENTRY:.*:]]
131+ // AIX-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.ppc.amo.lwat.cond(ptr [[PTR]], i32 24)
132+ // AIX-NEXT: store i32 [[TMP0]], ptr [[RESP]], align 4, !tbaa [[INT_TBAA2]]
133+ // AIX-NEXT: ret void
134+ //
135+ void test_signed_lwat_cond (int * ptr , int * resp ) {
136+ int res = __builtin_amo_lwat_cond_s (ptr , 24 );
137+ * resp = res ;
138+ }
139+
140+ // CHECK-LABEL: define dso_local void @test_signed_ldat_cond(
141+ // CHECK-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
142+ // CHECK-NEXT: [[ENTRY:.*:]]
143+ // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.ppc.amo.ldat.cond(ptr [[PTR]], i32 25)
144+ // CHECK-NEXT: store i64 [[TMP0]], ptr [[RESP]], align 8, !tbaa [[LONG_TBAA6]]
145+ // CHECK-NEXT: ret void
146+ //
147+ // AIX-LABEL: define void @test_signed_ldat_cond(
148+ // AIX-SAME: ptr noundef [[PTR:%.*]], ptr noundef writeonly captures(none) initializes((0, 8)) [[RESP:%.*]]) local_unnamed_addr #[[ATTR0]] {
149+ // AIX-NEXT: [[ENTRY:.*:]]
150+ // AIX-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.ppc.amo.ldat.cond(ptr [[PTR]], i32 25)
151+ // AIX-NEXT: store i64 [[TMP0]], ptr [[RESP]], align 8, !tbaa [[LONG_TBAA6]]
152+ // AIX-NEXT: ret void
153+ //
154+ void test_signed_ldat_cond (long int * ptr , long int * resp ) {
155+ long int res = __builtin_amo_ldat_cond_s (ptr , 25 );
156+ * resp = res ;
157+ }
158+
84159//.
85160// CHECK: [[INT_TBAA2]] = !{[[META3:![0-9]+]], [[META3]], i64 0}
86161// CHECK: [[META3]] = !{!"int", [[META4:![0-9]+]], i64 0}
0 commit comments