This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ptx preliminary address space fixes [3/4]
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 11 Sep 2014 13:39:08 +0200
- Subject: Re: ptx preliminary address space fixes [3/4]
- Authentication-results: sourceware.org; auth=none
- References: <54117586 dot 8050503 at codesourcery dot com>
On Thu, Sep 11, 2014 at 12:12 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> The vectorizer can also replace a memory reference without ensuring it uses
> the correct address space.
>
> Bootstrapped and tested together with the other patches on x86_64-linux.
> Ok?
Seeing this it would be nice to abstract away the exact place we store
the address-space in a memory reference. So - can you add a helper
reference_addr_space () please? Thus do
addr_space_t as = reference_addr_space (scalar_dest);
+ if (!ADDR_SPACE_GENERIC_P (as))
+ {
+ elem_type = apply_as_to_type (elem_type, as);
+ vectype = apply_as_to_type (vectype, as);
+ }
but then I wonder why not simply build the correct vector types
in the first place in vect_analyze_data_refs?
Or apply the addr-space to the memory reference with a new helper
reference_apply_addr_space
- data_ref = build2 (MEM_REF, TREE_TYPE (vec_oprnd), dataref_ptr,
dataref_offset
? dataref_offset
: build_int_cst (reference_alias_ptr_type
..
reference_apply_addr_space (data_ref, as);
at least that's how it's abstracted on the RTL side. I think I'd prefer
if things would be working that way on the tree level, too.
Thanks,
Richard.
>
> Bernd