diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-11-27 21:15:43 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-11-27 21:15:43 +0000 |
| commit | 0de1a4bc2d2632ceb42a022c52195de323740e73 (patch) | |
| tree | 2d93fe4f2d0f399395696ba1cce0f74b01fe7c09 /llvm/test/Transforms/PartiallyInlineLibCalls | |
| parent | 7c3a89231cbb560050062dd904149efb77263e9f (diff) | |
| download | bcm5719-llvm-0de1a4bc2d2632ceb42a022c52195de323740e73.tar.gz bcm5719-llvm-0de1a4bc2d2632ceb42a022c52195de323740e73.zip | |
[PartiallyInlineLibCalls][x86] add TTI hook to allow sqrt inlining to depend on arg rather than result
This should fix PR31455:
https://bugs.llvm.org/show_bug.cgi?id=31455
Differential Revision: https://reviews.llvm.org/D28314
llvm-svn: 319094
Diffstat (limited to 'llvm/test/Transforms/PartiallyInlineLibCalls')
| -rw-r--r-- | llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll b/llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll index 0011134640c..98aa4621986 100644 --- a/llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll +++ b/llvm/test/Transforms/PartiallyInlineLibCalls/X86/good-prototype.ll @@ -1,18 +1,20 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; 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]] +; CHECK-LABEL: @f( +; CHECK-NEXT: entry: +; CHECK-NEXT: [[RES:%.*]] = tail call float @sqrtf(float [[VAL:%.*]]) #0 +; CHECK-NEXT: [[TMP0:%.*]] = fcmp oge float [[VAL]], 0.000000e+00 +; CHECK-NEXT: br i1 [[TMP0]], label [[ENTRY_SPLIT:%.*]], label [[CALL_SQRT:%.*]] +; CHECK: call.sqrt: +; CHECK-NEXT: [[TMP1:%.*]] = tail call float @sqrtf(float [[VAL]]) +; CHECK-NEXT: br label [[ENTRY_SPLIT]] +; CHECK: entry.split: +; CHECK-NEXT: [[TMP2:%.*]] = phi float [ [[RES]], [[ENTRY:%.*]] ], [ [[TMP1]], [[CALL_SQRT]] ] +; CHECK-NEXT: ret float [[TMP2]] +; entry: %res = tail call float @sqrtf(float %val) ret float %res |

