This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ptx preliminary address space fixes [3/4]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]