Skip to content

Commit f381f35

Browse files
committed
Add positive test for sqrt "partial inlining". NFC.
llvm-svn: 291009
1 parent 0f9d111 commit f381f35

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
; RUN: opt -S -partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
2+
; RUN: opt -S -passes=partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
3+
4+
define float @f(float %val) {
5+
; CHECK: @f
6+
; CHECK: entry:
7+
; CHECK-NEXT: %[[RES:.+]] = tail call float @sqrtf(float %val) #0
8+
; CHECK-NEXT: %[[CMP:.+]] = fcmp oeq float %[[RES]], %[[RES]]
9+
; CHECK-NEXT: br i1 %[[CMP]], label %[[EXIT:.+]], label %[[CALL:.+]]
10+
; CHECK: [[CALL]]:
11+
; CHECK-NEXT: %[[RES2:.+]] = tail call float @sqrtf(float %val){{$}}
12+
; CHECK-NEXT: br label %[[EXIT]]
13+
; CHECK: [[EXIT]]:
14+
; CHECK-NEXT: %[[RET:.+]] = phi float [ %[[RES]], %entry ], [ %[[RES2]], %[[CALL]] ]
15+
; CHECK-NEXT: ret float %[[RET]]
16+
entry:
17+
%res = tail call float @sqrtf(float %val)
18+
ret float %res
19+
}
20+
21+
declare float @sqrtf(float)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if not 'X86' in config.root.targets:
2+
config.unsupported = True

0 commit comments

Comments
 (0)