diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-07-22 04:54:44 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-07-22 04:54:44 +0000 |
| commit | 522a91181af75702f1526640d8fd356e22ea383a (patch) | |
| tree | 40ee58b3e30ca6cdbdf69e8bd1881b4ec2a23afc /llvm/test | |
| parent | d382e9d82b086187601cf786d4143816e124eb9f (diff) | |
| download | bcm5719-llvm-522a91181af75702f1526640d8fd356e22ea383a.tar.gz bcm5719-llvm-522a91181af75702f1526640d8fd356e22ea383a.zip | |
Don't remove side effecting instructions due to ConstantFoldInstruction
Just because we can constant fold the result of an instruction does not
imply that we can delete the instruction. It may have side effects.
This fixes PR28655.
llvm-svn: 276389
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/ConstProp/calls.ll | 80 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/call.ll | 11 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/log-pow.ll | 3 |
3 files changed, 53 insertions, 41 deletions
diff --git a/llvm/test/Transforms/ConstProp/calls.ll b/llvm/test/Transforms/ConstProp/calls.ll index 736d8c1365f..d9a884a4a7b 100644 --- a/llvm/test/Transforms/ConstProp/calls.ll +++ b/llvm/test/Transforms/ConstProp/calls.ll @@ -1,47 +1,47 @@ ; RUN: opt < %s -constprop -S | FileCheck %s ; RUN: opt < %s -constprop -disable-simplify-libcalls -S | FileCheck %s --check-prefix=FNOBUILTIN -declare double @acos(double) -declare double @asin(double) -declare double @atan(double) -declare double @atan2(double, double) -declare double @ceil(double) -declare double @cos(double) -declare double @cosh(double) -declare double @exp(double) -declare double @exp2(double) -declare double @fabs(double) -declare double @floor(double) -declare double @fmod(double, double) -declare double @log(double) -declare double @log10(double) -declare double @pow(double, double) -declare double @sin(double) -declare double @sinh(double) -declare double @sqrt(double) -declare double @tan(double) -declare double @tanh(double) +declare double @acos(double) readnone nounwind +declare double @asin(double) readnone nounwind +declare double @atan(double) readnone nounwind +declare double @atan2(double, double) readnone nounwind +declare double @ceil(double) readnone nounwind +declare double @cos(double) readnone nounwind +declare double @cosh(double) readnone nounwind +declare double @exp(double) readnone nounwind +declare double @exp2(double) readnone nounwind +declare double @fabs(double) readnone nounwind +declare double @floor(double) readnone nounwind +declare double @fmod(double, double) readnone nounwind +declare double @log(double) readnone nounwind +declare double @log10(double) readnone nounwind +declare double @pow(double, double) readnone nounwind +declare double @sin(double) readnone nounwind +declare double @sinh(double) readnone nounwind +declare double @sqrt(double) readnone nounwind +declare double @tan(double) readnone nounwind +declare double @tanh(double) readnone nounwind -declare float @acosf(float) -declare float @asinf(float) -declare float @atanf(float) -declare float @atan2f(float, float) -declare float @ceilf(float) -declare float @cosf(float) -declare float @coshf(float) -declare float @expf(float) -declare float @exp2f(float) -declare float @fabsf(float) -declare float @floorf(float) -declare float @fmodf(float, float) -declare float @logf(float) -declare float @log10f(float) -declare float @powf(float, float) -declare float @sinf(float) -declare float @sinhf(float) -declare float @sqrtf(float) -declare float @tanf(float) -declare float @tanhf(float) +declare float @acosf(float) readnone nounwind +declare float @asinf(float) readnone nounwind +declare float @atanf(float) readnone nounwind +declare float @atan2f(float, float) readnone nounwind +declare float @ceilf(float) readnone nounwind +declare float @cosf(float) readnone nounwind +declare float @coshf(float) readnone nounwind +declare float @expf(float) readnone nounwind +declare float @exp2f(float) readnone nounwind +declare float @fabsf(float) readnone nounwind +declare float @floorf(float) readnone nounwind +declare float @fmodf(float, float) readnone nounwind +declare float @logf(float) readnone nounwind +declare float @log10f(float) readnone nounwind +declare float @powf(float, float) readnone nounwind +declare float @sinf(float) readnone nounwind +declare float @sinhf(float) readnone nounwind +declare float @sqrtf(float) readnone nounwind +declare float @tanf(float) readnone nounwind +declare float @tanhf(float) readnone nounwind define double @T() { ; CHECK-LABEL: @T( diff --git a/llvm/test/Transforms/InstCombine/call.ll b/llvm/test/Transforms/InstCombine/call.ll index ea338f0bf58..5307dcb6df7 100644 --- a/llvm/test/Transforms/InstCombine/call.ll +++ b/llvm/test/Transforms/InstCombine/call.ll @@ -276,3 +276,14 @@ define <2 x i16> @test16() { %X = call <2 x i16> bitcast (i32 ()* @test16a to <2 x i16> ()*)( ) ret <2 x i16> %X } + +declare i32 @pr28655(i32 returned %V) + +define i32 @test17() { +entry: + %C = call i32 @pr28655(i32 0) + ret i32 %C +} +; CHECK-LABEL: @test17( +; CHECK: call i32 @pr28655(i32 0) +; CHECK: ret i32 0 diff --git a/llvm/test/Transforms/InstCombine/log-pow.ll b/llvm/test/Transforms/InstCombine/log-pow.ll index a0c10d0a0b8..4e4a2b2612c 100644 --- a/llvm/test/Transforms/InstCombine/log-pow.ll +++ b/llvm/test/Transforms/InstCombine/log-pow.ll @@ -55,7 +55,8 @@ define double @log_exp2_not_fast(double %x) { ; CHECK-NEXT: %call3 = call fast double @log(double %call2) ; CHECK-NEXT: ret double %call3 -declare double @log(double) +declare double @log(double) #0 declare double @exp2(double) declare double @llvm.pow.f64(double, double) +attributes #0 = { nounwind readnone } |

