diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-03-26 09:42:31 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-03-26 09:42:31 +0000 |
commit | b549ab02b4659c2e6164cb1a39ef798b80d643df (patch) | |
tree | d092eb943e796355e898b72b4097c0a3c69fcb39 /llvm/test/CodeGen/PowerPC | |
parent | 9a5f19f50982790b6004cbd11787ef7f52c0b8a2 (diff) | |
download | bcm5719-llvm-b549ab02b4659c2e6164cb1a39ef798b80d643df.tar.gz bcm5719-llvm-b549ab02b4659c2e6164cb1a39ef798b80d643df.zip |
[PowerPC] Disable the CTR optimization in the presence of {min,max}num
The minnum and maxnum intrinsics get lowered to libcalls which
invalidates the CTR optimization.
This fixes PR27083.
llvm-svn: 264508
Diffstat (limited to 'llvm/test/CodeGen/PowerPC')
-rw-r--r-- | llvm/test/CodeGen/PowerPC/ctr-minmaxnum.ll | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/ctr-minmaxnum.ll b/llvm/test/CodeGen/PowerPC/ctr-minmaxnum.ll new file mode 100644 index 00000000000..c109b437ced --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/ctr-minmaxnum.ll @@ -0,0 +1,44 @@ +; RUN: llc < %s | FileCheck %s +target triple = "powerpc64le-unknown-linux-gnu" + +define void @test1(float %f, float* %fp) { +entry: + br label %loop_body + +loop_body: + %invar_address.dim.0.01 = phi i64 [ 0, %entry ], [ %1, %loop_body ] + %0 = call float @llvm.minnum.f32(float %f, float 1.0) + store float %0, float* %fp, align 4 + %1 = add i64 %invar_address.dim.0.01, 1 + %2 = icmp eq i64 %1, 2 + br i1 %2, label %loop_exit, label %loop_body + +loop_exit: + ret void +} + +; CHECK-LABEL: test1: +; CHECK: bl fminf + + +define void @test2(float %f, float* %fp) { +entry: + br label %loop_body + +loop_body: + %invar_address.dim.0.01 = phi i64 [ 0, %entry ], [ %1, %loop_body ] + %0 = call float @llvm.maxnum.f32(float %f, float 1.0) + store float %0, float* %fp, align 4 + %1 = add i64 %invar_address.dim.0.01, 1 + %2 = icmp eq i64 %1, 2 + br i1 %2, label %loop_exit, label %loop_body + +loop_exit: + ret void +} + +; CHECK-LABEL: test2: +; CHECK: bl fmaxf + +declare float @llvm.minnum.f32(float, float) +declare float @llvm.maxnum.f32(float, float) |