This is the mail archive of the
mailing list for the GCC project.
Re: Setting alias set and vuse/vdef on gimple statements
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 28 Jun 2016 15:15:19 +0200
- Subject: Re: Setting alias set and vuse/vdef on gimple statements
- Authentication-results: sourceware.org; auth=none
- References: <576417E5 dot 2060308 at foss dot arm dot com>
On Fri, Jun 17, 2016 at 5:31 PM, Kyrill Tkachov
> Hi all,
> I'm working on a tree-ssa pass to implement PR 22141, a pass that merges
> adjacent stores.
> I've gotten to the point where I can identify the adjacent accesses, merge
> them into a single value
> and am now working on emitting the new statements but, as I don't have a lot
> of experience with the gimple
> machinery, am not sure what to do about alias sets and other bookkeeping.
> At the point where I'm emitting the single wide store to replace a number of
> narrow consecutive stores
> I construct a MEM_REF that I assign the wide merged value to.
> I think I need to also set its alias info but am not sure how to construct
> Conceptually I need the disjunction of all the alias sets of the stores that
> the new store replaces
> but I'm not sure how to get that. I can get the alias set of a single gimple
> statement through
> get_alias_set of the LHS of each gimple assignment but how do I merge them?
> I don't see a helper function for that that springs to mind...
There are reference_alias_ptr_type and alias_ptr_types_compatible_p. When
you get a false from the latter you have to use ptr_type_node (you get
> Also, from what I understand gimple statements that write to memory have
> these vdef operands but I'm
> not sure what the vdef operand for the new store that replaces the series of
> adjacent stores should be
> set to (or how to construct it).
Use the VDEF from the last store and the VUSE from the earliest.
You can also get them re-built via update-ssa but that's expensive.
> Any guidance on this would be very appreciated.