This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]