summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kuperstein <mkuper@google.com>2017-01-04 21:24:56 +0000
committerMichael Kuperstein <mkuper@google.com>2017-01-04 21:24:56 +0000
commitf381f359778c41cb183385f213d6a2aca04a6b61 (patch)
treed75e856d6c8beee25325ec84934f518fa7a7572b
parent0f9d111f9730ba54b5c04ac597acd07567bb6a20 (diff)
downloadbcm5719-llvm-f381f359778c41cb183385f213d6a2aca04a6b61.tar.gz
bcm5719-llvm-f381f359778c41cb183385f213d6a2aca04a6b61.zip
Add positive test for sqrt "partial inlining". NFC.
llvm-svn: 291009
-rw-r--r--llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll21
-rw-r--r--llvm/test/Transforms/PartiallyInlineLibCalls/X86/lit.local.cfg2
2 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll b/llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll
new file mode 100644
index 00000000000..0011134640c
--- /dev/null
+++ b/llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll
@@ -0,0 +1,21 @@
+; RUN: opt -S -partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
+; RUN: opt -S -passes=partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
+
+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)
diff --git a/llvm/test/Transforms/PartiallyInlineLibCalls/X86/lit.local.cfg b/llvm/test/Transforms/PartiallyInlineLibCalls/X86/lit.local.cfg
new file mode 100644
index 00000000000..afde89be896
--- /dev/null
+++ b/llvm/test/Transforms/PartiallyInlineLibCalls/X86/lit.local.cfg
@@ -0,0 +1,2 @@
+if not 'X86' in config.root.targets:
+ config.unsupported = True
OpenPOWER on IntegriCloud