On Mon, 8 Apr 2024, Hanke Zhang via Gcc wrote:
Hi,
I've been working on strengthening auto-vectorization on intel CPUs
recently. I tried to do it in the GIMPLE pass. And I noticed that some
vector types in the GIMPLE code are confusing to me. The example code
is here:
_1 = MEM[(const __m256i_u * {ref-all})_2];
I wondered how I could construct or get the type `(const __m256i_u *
{ref-all})` in the GIMPLE pass.
If you have any ideas that can help me. I'll be so grateful! :)
I am not sure what you are asking exactly. If you already have access to
such a MEM_REF, then the doc tells you where to look for this type:
"The first operand is the pointer being dereferenced; it will always have
pointer or reference type. The second operand is a pointer constant
serving as constant offset applied to the pointer being dereferenced
with its type specifying the type to be used for type-based alias
analysis.
The type of the node specifies the alignment of the access."
If you want to create a new type similar to this one, you can build it
with various tools:
build_vector_type or build_vector_type_for_mode
build_pointer_type_for_mode(*, VOIDmode, true) to build a pointer that can
alias anything
build_qualified_type to add const (probably useless)
build_aligned_type to specify that it is unaligned
--
Marc Glisse