public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39469] Calculated values replaced with constants even if the constants cost more than the calculations
[not found] <bug-39469-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-02 8:55 ` pinskia at gcc dot gnu.org
2012-12-09 23:31 ` siarhei.siamashka at gmail dot com
2012-12-10 0:24 ` siarhei.siamashka at gmail dot com
2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-02 8:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39469
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |arm*-*-*
Component|middle-end |target
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-02 08:54:44 UTC ---
The ARM backend should do a splitter just like the rs6000 back-end does if it
is faster/smaller to load a constant via the instructions.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/39469] Calculated values replaced with constants even if the constants cost more than the calculations
[not found] <bug-39469-4@http.gcc.gnu.org/bugzilla/>
2012-01-02 8:55 ` [Bug target/39469] Calculated values replaced with constants even if the constants cost more than the calculations pinskia at gcc dot gnu.org
@ 2012-12-09 23:31 ` siarhei.siamashka at gmail dot com
2012-12-10 0:24 ` siarhei.siamashka at gmail dot com
2 siblings, 0 replies; 3+ messages in thread
From: siarhei.siamashka at gmail dot com @ 2012-12-09 23:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39469
--- Comment #5 from Siarhei Siamashka <siarhei.siamashka at gmail dot com> 2012-12-09 23:31:33 UTC ---
(In reply to comment #4)
> The ARM backend should do a splitter just like the rs6000 back-end does if it
> is faster/smaller to load a constant via the instructions.
I'm not sure if rs6000 is any better. It looks just as bad as ARM, based on my
experience trying to optimize
http://lists.freedesktop.org/archives/pixman/2012-December/002394.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/39469] Calculated values replaced with constants even if the constants cost more than the calculations
[not found] <bug-39469-4@http.gcc.gnu.org/bugzilla/>
2012-01-02 8:55 ` [Bug target/39469] Calculated values replaced with constants even if the constants cost more than the calculations pinskia at gcc dot gnu.org
2012-12-09 23:31 ` siarhei.siamashka at gmail dot com
@ 2012-12-10 0:24 ` siarhei.siamashka at gmail dot com
2 siblings, 0 replies; 3+ messages in thread
From: siarhei.siamashka at gmail dot com @ 2012-12-10 0:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39469
--- Comment #6 from Siarhei Siamashka <siarhei.siamashka at gmail dot com> 2012-12-10 00:24:12 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> > The ARM backend should do a splitter just like the rs6000 back-end does if it
> > is faster/smaller to load a constant via the instructions.
>
> I'm not sure if rs6000 is any better. It looks just as bad as ARM, based on my
> experience trying to optimize
> http://lists.freedesktop.org/archives/pixman/2012-December/002394.html
And the testcase attached to this bug compiles to the following code with
powerpc-unknown-linux-gnu-gcc (-O2 optimizations):
.file "test.c"
.section ".text"
.align 2
.globl foo
.type foo, @function
foo:
lis 8,0x5f5
lis 10,array@ha
ori 8,8,57600
la 9,array@l(10)
stw 8,array@l(10)
lis 10,0xbeb
ori 10,10,49664
stw 10,4(9)
lis 10,0x17d7
ori 10,10,33792
stw 10,8(9)
lis 10,0x2faf
ori 10,10,2048
stw 10,12(9)
blr
.size foo, .-foo
.align 2
.globl bar
.type bar, @function
bar:
lis 10,array@ha
slwi 6,3,1
la 9,array@l(10)
slwi 7,3,2
slwi 8,3,3
stw 3,array@l(10)
stw 6,4(9)
stw 7,8(9)
stw 8,12(9)
blr
.size bar, .-bar
.ident "GCC: (GNU) 4.8.0 20121209 (experimental)"
.section .note.GNU-stack,"",@progbits
That's 15 instructions in "foo" vs. 10 in "bar". For MIPS the difference is 16
instructions vs. 11 (I'm not posting the code because it is rather similar).
Is this really an ARM target bug?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-12-10 0:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-39469-4@http.gcc.gnu.org/bugzilla/>
2012-01-02 8:55 ` [Bug target/39469] Calculated values replaced with constants even if the constants cost more than the calculations pinskia at gcc dot gnu.org
2012-12-09 23:31 ` siarhei.siamashka at gmail dot com
2012-12-10 0:24 ` siarhei.siamashka at gmail dot com
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).