From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by sourceware.org (Postfix) with ESMTPS id 5ACC3385842A for ; Tue, 9 Apr 2024 02:40:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5ACC3385842A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5ACC3385842A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712630437; cv=none; b=XKoM/jFwJHil9YL2nMvEwdlc8tn7JKdBzyX9B3dO6o3o7w2IxbYNeDxmRJviPAGE42XtAk9+yguZAKTYPR0k7gmktQ2l1AcjQkpk1u1vcHK6okB3N391awOlXkPEuERxSkWKixFquz+Boh1Pl7obJHWslgxqD3uRjpXxWfJUkRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712630437; c=relaxed/simple; bh=vhw+z/q09dCW73ZNU/rhH55NYn+W/Zj8levth9cbqt8=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=PjIwT08j4c64SHeUpXunnKtSxE0wYmMfxYV/i9w27XmH+ZxlNjqorPrs6FuWO5rLVjAEAQpTtlz9CTKMpppGg5ku37HK3PGtGj/iMuwroUakiGPFOZ3OaEZDA6lS4VpWmAyK/0Yo7y+OwDXNoF2NSA3bsVB/WsLR1JgG0+zf3RQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-516d6e23253so3699232e87.1 for ; Mon, 08 Apr 2024 19:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712630433; x=1713235233; darn=gcc.gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3KdOKbspZuT7kg+OWsdJTiVWLn28w2aeBj5c3u3+PiI=; b=QPbDd3wI4nRLYdmZFn8XoU+ibh+hRqZfI7jqZiII+iAwg8fOqQKiV3drydmuUJ0AV+ Hx6kw5jjRVY+V97H5jc1X19oPy6+hmuoZNPBw2V8ShMeMDowEkt+IRGZy16CiUZdv9iU bWx/A37q+/+f0Zebxy11NmmgY2dww09hPk4Adto/wUXA6D7jeL8tKyXihvDHM9mZ7+wo 8LO39IOD4plKgbS+1i+z+JW998Ed3yPH2m+/FTK3Otjsd60jw77UI4wSuUVheRLCjiyK nc+FMgW6mp9Zw0w531gCFSIt74G6ooStfSEiKocazeAz5ukwWergJZGI10KQN2VgME1n bFmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712630433; x=1713235233; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3KdOKbspZuT7kg+OWsdJTiVWLn28w2aeBj5c3u3+PiI=; b=Kben5+MqZgU8JGhh7MzZPAjCGwM81WGfod6E171uvOMCfRrJOlrDxfMVQwM2ekleow 5FpamJEfDrlmeM+kJGyScRScbTVz0Ow8dA+SdciIdUrRvHWmqdGTBhMPAmNYvLTvSo7v Ry1amiztGAfqQ6o14fyq9P9mJSThg2mk06Om2obkJHj+nx7SI4aymPeME8QMVHLY7Bkk h1oRJfPUH0TZyox4GDiowFiLOb7cbemyQi9fqapPVSmyVJZ92jYwJ92ic+jOZp5YjJJp lMO6b1MEmGlWr40e3rq9GeXHlEHMB9Ql2nQTej3XWvQFVlA7o6j15cICuxo5UegOae5c utrw== X-Gm-Message-State: AOJu0Yz/lQ4rqa7TAiWKZf11V595Xs3JPGlU5bBG/FzkWTLbjSZa2rU/ ulbXZXMf0eir72XbEWbBALT8Ptds/euPxNhPCIMLF2ZRdBazCG+wW4BuakIz4i7Oa1juBnN+fVc 3ZiM9XgzZXFqIlBXq9LbbmJz3LaTArwAG+TKKwA== X-Google-Smtp-Source: AGHT+IEZnpcfne3GK4IOpJ7m6UUY1qUHls7gHHsu10bV0t4UaPKQQegoMEpEALbav7ybllmSQ2ISiUzXExPaceBft5s= X-Received: by 2002:a19:4319:0:b0:513:c757:33d9 with SMTP id q25-20020a194319000000b00513c75733d9mr7027548lfa.53.1712630433178; Mon, 08 Apr 2024 19:40:33 -0700 (PDT) MIME-Version: 1.0 References: <3e8f4655-1d0a-2de4-9520-5e6a4fddc2b9@inria.fr> In-Reply-To: <3e8f4655-1d0a-2de4-9520-5e6a4fddc2b9@inria.fr> From: Hanke Zhang Date: Tue, 9 Apr 2024 10:40:22 +0800 Message-ID: Subject: Re: Question about constructing vector types in GIMPLE pass To: GCC Development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Marc, Thanks for your reply. I want to create a new type similar to this one `(const __m256i_u * {ref-all})` indeed. And I try to create it via these calls: tree type =3D build_vector_type_for_mode (intDI_type_node, V4DImode); tree type_p =3D build_pointer_type_for_mode(type, VOIDmode, true); But when I print the `type_p`, it shows `vector(4) long int * {ref-all}`. So I'm confused if they are the same type or can be transferred to each other. And I'm stucked with another problem that, I want to call `__builtin_ia32_pmovmskb256` in the GIMPLE pass. But I found that this function is defined in `config/i386/i386-builtins.h`. And when I try to include this header file, the error will occur during the compilation. If you know any way to solve this problem, I would be very grateful. :) Thanks Hanke Zhang Marc Glisse =E4=BA=8E2024=E5=B9=B44=E6=9C=889=E6=97= =A5=E5=91=A8=E4=BA=8C 03:01=E5=86=99=E9=81=93=EF=BC=9A > > 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 =3D 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 ca= n alias anything > build_qualified_type to add const (probably useless) > build_aligned_type to specify that it is unaligned > > -- > Marc Glisse