public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted
@ 2004-06-18  6:16 tjw at omnigroup dot com
  2004-06-18  6:17 ` [Bug tree-optimization/16047] " tjw at omnigroup dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tjw at omnigroup dot com @ 2004-06-18  6:16 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/16047] lno promotion of float scalar to float vector doesn't get hoisted
  2004-06-18  6:16 [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted tjw at omnigroup dot com
@ 2004-06-18  6:17 ` tjw at omnigroup dot com
  2004-06-19  6:03 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tjw at omnigroup dot com @ 2004-06-18  6:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tjw at omnigroup dot com  2004-06-18 06:17 -------
Created an attachment (id=6553)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6553&action=view)
Test case


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16047


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/16047] lno promotion of float scalar to float vector doesn't get hoisted
  2004-06-18  6:16 [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted tjw at omnigroup dot com
  2004-06-18  6:17 ` [Bug tree-optimization/16047] " tjw at omnigroup dot com
@ 2004-06-19  6:03 ` pinskia at gcc dot gnu dot org
  2004-06-21 19:51 ` dpatel at apple dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-19  6:03 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
   Target Milestone|---                         |lno


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16047


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/16047] lno promotion of float scalar to float vector doesn't get hoisted
  2004-06-18  6:16 [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted tjw at omnigroup dot com
  2004-06-18  6:17 ` [Bug tree-optimization/16047] " tjw at omnigroup dot com
  2004-06-19  6:03 ` pinskia at gcc dot gnu dot org
@ 2004-06-21 19:51 ` dpatel at apple dot com
  2004-08-15  5:40 ` [Bug target/16047] [PPC] " pinskia at gcc dot gnu dot org
  2004-08-25  5:33 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dpatel at apple dot com @ 2004-06-21 19:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dpatel at apple dot com  2004-06-21 19:51 -------
This is a known altivec codegen deficiency.

See http://gcc.gnu.org/ml/gcc/2004-03/msg01322.html

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16047


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/16047] [PPC] lno promotion of float scalar to float vector doesn't get hoisted
  2004-06-18  6:16 [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted tjw at omnigroup dot com
                   ` (2 preceding siblings ...)
  2004-06-21 19:51 ` dpatel at apple dot com
@ 2004-08-15  5:40 ` pinskia at gcc dot gnu dot org
  2004-08-25  5:33 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-15  5:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-15 05:40 -------
Confirmed, a target problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|tree-optimization           |target
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-15 05:40:21
               date|                            |
            Summary|lno promotion of float      |[PPC] lno promotion of float
                   |scalar to float vector      |scalar to float vector
                   |doesn't get hoisted         |doesn't get hoisted
   Target Milestone|lno                         |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16047


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/16047] [PPC] lno promotion of float scalar to float vector doesn't get hoisted
  2004-06-18  6:16 [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted tjw at omnigroup dot com
                   ` (3 preceding siblings ...)
  2004-08-15  5:40 ` [Bug target/16047] [PPC] " pinskia at gcc dot gnu dot org
@ 2004-08-25  5:33 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-25  5:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-25 05:33 -------
And that would be a dup of bug 10469.

*** This bug has been marked as a duplicate of 10469 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16047


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-25  5:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-18  6:16 [Bug tree-optimization/16047] New: lno promotion of float scalar to float vector doesn't get hoisted tjw at omnigroup dot com
2004-06-18  6:17 ` [Bug tree-optimization/16047] " tjw at omnigroup dot com
2004-06-19  6:03 ` pinskia at gcc dot gnu dot org
2004-06-21 19:51 ` dpatel at apple dot com
2004-08-15  5:40 ` [Bug target/16047] [PPC] " pinskia at gcc dot gnu dot org
2004-08-25  5:33 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).