summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kuperstein <mkuper@google.com>2017-01-04 20:48:30 +0000
committerMichael Kuperstein <mkuper@google.com>2017-01-04 20:48:30 +0000
commitfc74da13a967f084c84b8526c9e2c0131973da58 (patch)
tree206407c2b6fde0cbac18d23c0c38481ffaa7e3f2
parent6309895770292d4f0815b737d0dcfe2cdd605099 (diff)
downloadbcm5719-llvm-fc74da13a967f084c84b8526c9e2c0131973da58.tar.gz
bcm5719-llvm-fc74da13a967f084c84b8526c9e2c0131973da58.zip
Add positive test for sqrt "partial inlining". NFC.
llvm-svn: 291001
-rw-r--r--llvm/test/Transforms/PartiallyInlineLibCalls/good-prototype.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Transforms/PartiallyInlineLibCalls/good-prototype.ll b/llvm/test/Transforms/PartiallyInlineLibCalls/good-prototype.ll
new file mode 100644
index 00000000000..ed975052732
--- /dev/null
+++ b/llvm/test/Transforms/PartiallyInlineLibCalls/good-prototype.ll
@@ -0,0 +1,23 @@
+; RUN: opt -S -partially-inline-libcalls < %s | FileCheck %s
+; RUN: opt -S -passes=partially-inline-libcalls < %s | FileCheck %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define float @f(float %val) {
+; CHECK: @f
+; CHECK: entry:
+; CHECK-NEXT: %[[RES:.+]] = tail call float @sqrtf(float %val) #0
+; CHECK-NEXT: %[[CMP:.+]] = fcmp oeq float %[[RES]], %[[RES]]
+; CHECK-NEXT: br i1 %[[CMP]], label %[[EXIT:.+]], label %[[CALL:.+]]
+; CHECK: [[CALL]]:
+; CHECK-NEXT: %[[RES2:.+]] = tail call float @sqrtf(float %val){{$}}
+; CHECK-NEXT: br label %[[EXIT]]
+; CHECK: [[EXIT]]:
+; CHECK-NEXT: %[[RET:.+]] = phi float [ %[[RES]], %entry ], [ %[[RES2]], %[[CALL]] ]
+; CHECK-NEXT: ret float %[[RET]]
+entry:
+ %res = tail call float @sqrtf(float %val)
+ ret float %res
+}
+
+declare float @sqrtf(float)
OpenPOWER on IntegriCloud