From 5ee67e8e76dfcaffa5e776ef3d5eeb80807a627b Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Mon, 8 Apr 2013 16:24:03 +0000 Subject: Generate PPC early conditional returns PowerPC has a conditional branch to the link register (return) instruction: BCLR. This should be used any time when we'd otherwise have a conditional branch to a return. This adds a small pass, PPCEarlyReturn, which runs just prior to the branch selection pass (and, importantly, after block placement) to generate these conditional returns when possible. It will also eliminate unconditional branches to returns (these happen rarely; most of the time these have already been tail duplicated by the time PPCEarlyReturn is invoked). This is a nice optimization for small functions that do not maintain a stack frame. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179026 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/PowerPC/rounding-ops.ll | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/CodeGen/PowerPC/rounding-ops.ll') diff --git a/test/CodeGen/PowerPC/rounding-ops.ll b/test/CodeGen/PowerPC/rounding-ops.ll index b210a6bda8b..2b5e1c9a289 100644 --- a/test/CodeGen/PowerPC/rounding-ops.ll +++ b/test/CodeGen/PowerPC/rounding-ops.ll @@ -107,9 +107,10 @@ define double @test10(double %x) nounwind { declare double @trunc(double) nounwind readnone -define float @test11(float %x) nounwind { +define void @test11(float %x, float* %y) nounwind { %call = tail call float @rintf(float %x) nounwind readnone - ret float %call + store float %call, float* %y + ret void ; CHECK: test11: ; CHECK-NOT: frin @@ -125,9 +126,10 @@ define float @test11(float %x) nounwind { declare float @rintf(float) nounwind readnone -define double @test12(double %x) nounwind { +define void @test12(double %x, double* %y) nounwind { %call = tail call double @rint(double %x) nounwind readnone - ret double %call + store double %call, double* %y + ret void ; CHECK: test12: ; CHECK-NOT: frin -- cgit v1.2.3