On Thu, Sep 11, 2014 at 12:12 PM, Bernd Schmidt <[email protected]> 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