From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19244 invoked by alias); 18 Jun 2004 06:16:31 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19234 invoked by uid 48); 18 Jun 2004 06:16:29 -0000 Date: Fri, 18 Jun 2004 06:16:00 -0000 From: "tjw at omnigroup dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20040618061626.16047.tjw@omnigroup.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg02189.txt.bz2 List-Id: When compiled with: $PREFIX/bin/gcc -O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec -S test-add-float.c -o / tmp/test-add-float.s The attached test case produces assembly like: _test: mfspr r12,256 stw r12,-8(r1) oris r12,r12,0xc000 mtspr 256,r12 li r0,128 stfs f1,-48(r1) << Stores float to stack mtctr r0 lwz r9,-48(r1) << Loads it back into a GPR mr r8,r3 stw r31,-4(r1) mr r3,r4 mr r10,r9 mr r11,r9 mr r12,r9 li r2,0 L2: addi r7,r1,-32 << Redundant computation of stack offset lvx v0,r2,r8 stw r9,0(r7) << Stores the GPR version of the float inside the loop stw r10,4(r7) stw r11,8(r7) stw r12,12(r7) lvx v1,0,r7 << Loads the vector off the stack vaddfp v0,v0,v1 stvx v0,r2,r3 addi r2,r2,16 bdnz L2 Instead, this should pick a vector aligned blob of memory on the stack and store the float to element zero. Then, outside, the loop, that vector should be loaded and the elements replicated via a splat instruction. Even if the compiler can't do the splat part yet, the four stores and the load of the vector should be hoisted. -- Summary: lno promotion of float scalar to float vector doesn't get hoisted Product: gcc Version: lno Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tjw at omnigroup dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-apple-darwin7.4.0 GCC host triplet: powerpc-apple-darwin7.4.0 GCC target triplet: powerpc-apple-darwin7.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16047