diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-01-12 16:50:17 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-01-12 16:50:17 +0000 |
commit | 71e550fefbf0e5200ebfc201a9accd4d0ca78d3d (patch) | |
tree | 8e5f8a0d65de3f19ad7018d89b4cc141bfb50ada | |
parent | acdff46a9c82477311102f628e92e195791264e0 (diff) | |
download | bcm5719-llvm-71e550fefbf0e5200ebfc201a9accd4d0ca78d3d.tar.gz bcm5719-llvm-71e550fefbf0e5200ebfc201a9accd4d0ca78d3d.zip |
Add/edit tests to include instruction-level FMF on calls
Prepatory patch before changing LibCallSimplifier to use the FMF.
Also, tighten the CHECK lines and give the tests more meaningful names.
Similar changes to:
http://reviews.llvm.org/rL257414
llvm-svn: 257481
-rw-r--r-- | llvm/test/Transforms/InstCombine/pow-exp.ll | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/llvm/test/Transforms/InstCombine/pow-exp.ll b/llvm/test/Transforms/InstCombine/pow-exp.ll index acc512734ec..7e36eadb402 100644 --- a/llvm/test/Transforms/InstCombine/pow-exp.ll +++ b/llvm/test/Transforms/InstCombine/pow-exp.ll @@ -1,28 +1,40 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s -define double @mypow(double %x, double %y) #0 { -entry: +define double @pow_exp(double %x, double %y) #0 { + %call = call fast double @exp(double %x) #0 + %pow = call fast double @llvm.pow.f64(double %call, double %y) + ret double %pow +} + +; CHECK-LABEL: define double @pow_exp( +; CHECK-NEXT: %mul = fmul fast double %x, %y +; CHECK-NEXT: %exp = call fast double @exp(double %mul) +; CHECK-NEXT: ret double %exp + +; FIXME: This should not be transformed because the 'exp' call is not fast. +define double @pow_exp_not_fast(double %x, double %y) #0 { %call = call double @exp(double %x) - %pow = call double @llvm.pow.f64(double %call, double %y) + %pow = call fast double @llvm.pow.f64(double %call, double %y) ret double %pow } -; CHECK-LABEL: define double @mypow( -; CHECK: %mul = fmul fast double %x, %y -; CHECK: %exp = call fast double @exp(double %mul) #0 -; CHECK: ret double %exp -; CHECK: } +; CHECK-LABEL: define double @pow_exp_not_fast( +; CHECK-NEXT: %call = call double @exp(double %x) +; CHECK-NEXT: %mul = fmul fast double %x, %y +; CHECK-NEXT: %exp = call fast double @exp(double %mul) +; CHECK-NEXT: ret double %exp -define double @test2(double ()* %fptr, double %p1) #0 { - %call1 = call double %fptr() - %pow = call double @llvm.pow.f64(double %call1, double %p1) +define double @function_pointer(double ()* %fptr, double %p1) #0 { + %call1 = call fast double %fptr() + %pow = call fast double @llvm.pow.f64(double %call1, double %p1) ret double %pow } -; CHECK-LABEL: @test2 -; CHECK: llvm.pow.f64 +; CHECK-LABEL: @function_pointer +; CHECK-NEXT: %call1 = call fast double %fptr() +; CHECK-NEXT: %pow = call fast double @llvm.pow.f64(double %call1, double %p1) -declare double @exp(double) #1 +declare double @exp(double) declare double @llvm.pow.f64(double, double) -attributes #0 = { "unsafe-fp-math"="true" } -attributes #1 = { "unsafe-fp-math"="true" } +attributes #0 = { "unsafe-fp-math"="true" nounwind readnone } + |