From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id 3B0503858D28 for ; Mon, 8 Apr 2024 19:01:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B0503858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inria.fr ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3B0503858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.134.164.104 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712602911; cv=none; b=NMA41qQGq3tRNCZsr0s9ab96HE5j2c/zZ/BMUAwzEpzllcNSyb5R01oOyOMzPr041DbbsxnRMVIlUplewhd3CQgiICSfvAp9mD7GizBdFeiAglcPvPxSnZBxC6akBOrMPpp2qPCMITk0TQnEjQpy0kB+Hz7MX0aBXm42QozzFgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712602911; c=relaxed/simple; bh=ZHnILODZ+Zgd2gFy46tLZgKA47NyOFgHD+h5L1n0rbk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=KI5cRS0zL88HJhkp1OuW5D6FGBQd5TTbHcSMAF+0Nbs23YjJibNcYwtm2TwCm4QRA9dZAXjQNPxg/DWQgsclDWZMQNW7duYOgAv77nhb9LXEU4i+XrOII2iJmPuy2lHuQUrDM3ypW0JqZVoH67BNXCx+wasnl3qiHMf/ClfyME4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:reply-to:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=5iPUiiZcdCH2fsHBf1oAbLMvqYrv2vI+zf8DBMPM1Ho=; b=jinGq6JE7hmGbw3cR6ebqDWKco/hoP6mbq6njZU5ThOQzwa2trbF+ob8 jiwW93KO7J20s2xdzORXQZvL5BLykOWorqv7IiK7E/Z6X1d+Yd8Zcv7gv we82/K1exX50nMD3lig9VsfxJ0cVwdL7M2LJ56HP4/k+bpJAliKsg9hW+ s=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=marc.glisse@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.07,187,1708383600"; d="scan'208";a="84195212" Received: from 71.79.12.109.rev.sfr.net (HELO hippo) ([109.12.79.71]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2024 21:01:48 +0200 Date: Mon, 8 Apr 2024 21:01:47 +0200 (CEST) From: Marc Glisse Reply-To: GCC Development To: Hanke Zhang cc: GCC Development Subject: Re: Question about constructing vector types in GIMPLE pass In-Reply-To: Message-ID: <3e8f4655-1d0a-2de4-9520-5e6a4fddc2b9@inria.fr> References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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