From cd74bb641552527a552d3dc101b89509b50cdfa9 Mon Sep 17 00:00:00 2001 From: Petar Jovanovic Date: Thu, 17 Mar 2016 17:11:33 +0000 Subject: [PowerPC] Disable CTR loops optimization for soft float operations This patch prevents CTR loops optimization when using soft float operations inside loop body. Soft float operations use function calls, but function calls are not allowed inside CTR optimized loops. Patch by Aleksandar Beserminji. Differential Revision: http://reviews.llvm.org/D17600 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263727 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/PowerPC/ctrloops-softfloat.ll | 129 +++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 test/CodeGen/PowerPC/ctrloops-softfloat.ll (limited to 'test/CodeGen/PowerPC/ctrloops-softfloat.ll') diff --git a/test/CodeGen/PowerPC/ctrloops-softfloat.ll b/test/CodeGen/PowerPC/ctrloops-softfloat.ll new file mode 100644 index 00000000000..037bfda7323 --- /dev/null +++ b/test/CodeGen/PowerPC/ctrloops-softfloat.ll @@ -0,0 +1,129 @@ +; RUN: llc -mtriple=powerpc-unknown-linux-gnu -O1 < %s | FileCheck %s + +; double x, y; +; +; void foo1() +; { +; x = y = 1.1; +; for (int i = 0; i < 175; i++) +; y = x + y; +; } +; void foo2() +; { +; x = y = 1.1; +; for (int i = 0; i < 175; i++) +; y = x - y; +; } +; void foo3() +; { +; x = y = 1.1; +; for (int i = 0; i < 175; i++) +; y = x * y; +; } +; void foo4() +; { +; x = y = 1.1; +; for (int i = 0; i < 175; i++) +; y = x / y; +; } + +target datalayout = "E-m:e-p:32:32-i64:64-n32" +target triple = "powerpc-buildroot-linux-gnu" + +@y = common global double 0.000000e+00, align 8 +@x = common global double 0.000000e+00, align 8 + +define void @foo1() #0 { + store double 1.100000e+00, double* @y, align 8 + store double 1.100000e+00, double* @x, align 8 + br label %2 + +;