From: Marc Glisse <marc.glisse@inria.fr>
To: Hanke Zhang <hkzhang455@gmail.com>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: Question about constructing vector types in GIMPLE pass
Date: Mon, 8 Apr 2024 21:01:47 +0200 (CEST) [thread overview]
Message-ID: <3e8f4655-1d0a-2de4-9520-5e6a4fddc2b9@inria.fr> (raw)
In-Reply-To: <CAM_DAs9jw2SmAkuk4_ViopVTHeyv9QMvHut4S6c-jbKU20F3mA@mail.gmail.com>
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
next prev parent reply other threads:[~2024-04-08 19:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 13:18 Hanke Zhang
2024-04-08 19:01 ` Marc Glisse [this message]
2024-04-09 2:40 ` Hanke Zhang
2024-04-09 6:58 ` Richard Biener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e8f4655-1d0a-2de4-9520-5e6a4fddc2b9@inria.fr \
--to=marc.glisse@inria.fr \
--cc=gcc@gcc.gnu.org \
--cc=hkzhang455@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).