This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about subregs on constants
- From: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 27 Oct 2015 17:47:19 +0100
- Subject: Question about subregs on constants
- Authentication-results: sourceware.org; auth=none
Hi,
what does speak against folding SUBREGs on constants in fold_rtx?
CSE does refuse to propagate constants into subreg expressions probably because fold_rtx does not
handle it - and in fact a subreg on a constant does not seem to be defined. I'm wondering why this
is the case? What's the problem with simplifying subregs on constants?
If there is a good reason not to fold things like:
(subreg:DI (const_int 1 [0x1]) 0)
What about simplifying?
(and:DI (subreg:DI (const_int 1 [0x1]) 0)
(const_int 63 [0x3f])))
May we take care of it in simplify_binary_operation perhaps?
I ran into these problems when trying to fix the shift patterns in the S/390 back end:
https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00346.html
I see a few performance regressions with it due to missed optimizations.
Bye,
-Andreas-