1- ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
22; RUN: opt -S -passes=partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
33
44define float @f (float %val ) {
55; CHECK-LABEL: @f(
66; CHECK-NEXT: entry:
7- ; CHECK-NEXT: [[RES:%.*]] = tail call float @sqrtf(float [[VAL:%.*]]) #[[READNONE:.* ]]
7+ ; CHECK-NEXT: [[RES:%.*]] = tail call float @sqrtf(float [[VAL:%.*]]) #[[ATTR0:[0-9]+ ]]
88; CHECK-NEXT: [[TMP0:%.*]] = fcmp oge float [[VAL]], 0.000000e+00
99; CHECK-NEXT: br i1 [[TMP0]], label [[ENTRY_SPLIT:%.*]], label [[CALL_SQRT:%.*]]
1010; CHECK: call.sqrt:
@@ -21,14 +21,32 @@ entry:
2121
2222define float @f_writeonly (float %val ) {
2323; CHECK-LABEL: @f_writeonly(
24- ; CHECK-NEXt: [[RES:%.*]] = tail call float @sqrtf(float [[VAL:%.*]]) #[[READNONE]]
24+ ; CHECK-NEXT: [[RES:%.*]] = tail call float @sqrtf(float [[VAL:%.*]]) #[[ATTR0]]
25+ ; CHECK-NEXT: [[TMP1:%.*]] = fcmp oge float [[VAL]], 0.000000e+00
26+ ; CHECK-NEXT: br i1 [[TMP1]], label [[DOTSPLIT:%.*]], label [[CALL_SQRT:%.*]]
27+ ; CHECK: call.sqrt:
28+ ; CHECK-NEXT: [[TMP2:%.*]] = tail call float @sqrtf(float [[VAL]]) #[[ATTR1:[0-9]+]]
29+ ; CHECK-NEXT: br label [[DOTSPLIT]]
30+ ; CHECK: .split:
31+ ; CHECK-NEXT: [[TMP3:%.*]] = phi float [ [[RES]], [[TMP0:%.*]] ], [ [[TMP2]], [[CALL_SQRT]] ]
32+ ; CHECK-NEXT: ret float [[TMP3]]
33+ ;
2534 %res = tail call float @sqrtf (float %val ) writeonly
2635 ret float %res
2736}
2837
2938define float @f_readonly (float %val ) {
39+ ; CHECK-LABEL: @f_readonly(
40+ ; CHECK-NEXT: [[RES:%.*]] = tail call float @sqrtf(float [[VAL:%.*]]) #[[ATTR2:[0-9]+]]
41+ ; CHECK-NEXT: ret float [[RES]]
42+ ;
3043 %res = tail call float @sqrtf (float %val ) readonly
3144 ret float %res
3245}
3346
3447declare float @sqrtf (float )
48+ ;.
49+ ; CHECK: attributes #[[ATTR0]] = { memory(none) }
50+ ; CHECK: attributes #[[ATTR1]] = { memory(write) }
51+ ; CHECK: attributes #[[ATTR2]] = { memory(read) }
52+ ;.
0 commit comments