This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] type promotion pass
- From: Steve Ellcey <sellcey at cavium dot com>
- To: Kugan Vivekanandarajah <kugan dot vivekanandarajah at linaro dot org>
- Cc: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>, Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, Richard Biener <richard dot guenther at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Tue, 19 Sep 2017 08:32:46 -0700
- Subject: Re: [RFC] type promotion pass
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Steve dot Ellcey at cavium dot com;
- References: <DB6PR0801MB2053C1BC62931E4B9DEE87CF836C0@DB6PR0801MB2053.eurprd08.prod.outlook.com> <firstname.lastname@example.org> <CAAgBjM=NYWxVwKcf+LAQdvmxNYjwpW1Hb23dxchNsnJ62=tqaQ@mail.gmail.com> <email@example.com> <CAELXzTPyBVy_AimTqBNyn-W7=MKoeigh_0=6=2UYASyGjfT9Fw@mail.gmail.com>
- Reply-to: sellcey at cavium dot com
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Tue, 2017-09-19 at 11:13 +1000, Kugan Vivekanandarajah wrote:
> > https://gcc.gnu.org/ml/gcc-patches/2017-09/msg00929.html
> I tried the testases you have in the patch with type promotion. Looks
> like forwprop is reversing the promotion there. I haven't looked in
> detail yet but -fno-tree-forwprop seems to remove 6 "and" from the
> test case. I have a slightly different version to what Prathamseh has
> posted and hope that there isn't any difference here.
I don't think there is any way the type promotion pass can help with
the test case I have for pr77729. The 'and' operations go away in
forwprop but there are still type conversions like 'unsigned_int_var =
(unsigned int) char_var' and that is going to generate an 'and'
instruction (or an extend instruction) in RTL unless we know that
char_var is stored in a register whose upper bits have already been
zeroed out somehow. In my test case the only way to know that is to
know that the load byte instruction zeroed them out.