llvm.org GIT mirror llvm / 45e8fce
Add positive test for sqrt "partial inlining". NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291009 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Kuperstein 2 years ago
2 changed file(s) with 23 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt -S -partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
1 ; RUN: opt -S -passes=partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
2
3 define float @f(float %val) {
4 ; CHECK: @f
5 ; CHECK: entry:
6 ; CHECK-NEXT: %[[RES:.+]] = tail call float @sqrtf(float %val) #0
7 ; CHECK-NEXT: %[[CMP:.+]] = fcmp oeq float %[[RES]], %[[RES]]
8 ; CHECK-NEXT: br i1 %[[CMP]], label %[[EXIT:.+]], label %[[CALL:.+]]
9 ; CHECK: [[CALL]]:
10 ; CHECK-NEXT: %[[RES2:.+]] = tail call float @sqrtf(float %val){{$}}
11 ; CHECK-NEXT: br label %[[EXIT]]
12 ; CHECK: [[EXIT]]:
13 ; CHECK-NEXT: %[[RET:.+]] = phi float [ %[[RES]], %entry ], [ %[[RES2]], %[[CALL]] ]
14 ; CHECK-NEXT: ret float %[[RET]]
15 entry:
16 %res = tail call float @sqrtf(float %val)
17 ret float %res
18 }
19
20 declare float @sqrtf(float)
0 if not 'X86' in config.root.targets:
1 config.unsupported = True