This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CSE not combining equivalent expressions.
- From: Mircea Namolaru <NAMOLARU at il dot ibm dot com>
- To: pranav dot bhandarkar at gmail dot com, gcc at gnu dot org
- Date: Wed, 17 Jan 2007 17:29:40 +0200
- Subject: Re: CSE not combining equivalent expressions.
> Thanks. Another question I have is that, in this case, will the
following
>
> http://gcc.gnu.org/wiki/Sign_Extension_Removal
>
> help in removal of the sign / zero extension ?
First, it seems to me that in your case:
(1) a = a | 1 /* a |= 1 */
(2) a = a | 1 /* a |= 1 */
the expressions "a | 1" in (1) and (2) are different as the "a"
is not the same. So there is nothing to do for CSE.
If the architecture has an instruction that does both the
store and the zero extension, the zero extension instructions
become redundant.
The sign extension algorithm is supposed to catch such cases, but
I suspect that in this simple case the regular combine is enough.
Mircea