From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 223DD3858C2F for ; Fri, 23 Jun 2023 19:14:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 223DD3858C2F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b5465a79cdso6226915ad.3 for ; Fri, 23 Jun 2023 12:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687547647; x=1690139647; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pBDRWSMJ72BkVL4Qay+d3sdpFL9YYosuzoJW6vTsNPs=; b=fdCJfGew9uLG7IlpKPnjtzH8KSPe/tMH8ySbyJDNEkMJvO1vk/w7TeLAcfsurxzc// pXGF48Uk4pJ7d0RqtY6WW1i5kLbCQrffe8pefYOXlWWbRVhJOPuWMRtFi+K9LU/T8Wwr RBTc+t6Ahdgfs3fNSUxxVYFNwrDJ+IMGZJObojGVH3KqH6TPM4KmaCRdtOZ55JaFIODm gHuGKDCXNXiv3co21OYp8GdaLwQvTbV0xN2K7TIVe2kqtZGALebTqS963B0NhyBU4MQh FkuiAsB6nl+pOJVog9jtnoC01NALiKiVTR3arSPZS4eUm+oqp2VTizKHsaed+Y1KQhPe 2ODQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687547647; x=1690139647; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pBDRWSMJ72BkVL4Qay+d3sdpFL9YYosuzoJW6vTsNPs=; b=Tgz1LdF1UPvtkF/ZLly6ryryx8u+zJAROQwXW1yET46sUcOvpDcp26rk3RKU3z8bLk 976M2ZZLSLKJsjnW/I0FMOxk8l+4IA8ifo1FalekVt/MYGqt0hWmRlaxuVDB81cyTHc/ x4naOGwgsTTj18syXZk7z33Eg+h/l5oUUJ69n/sI/wiOBpoA8L8NKu96dR6W+k6mY3IC bf5RD2EGaj8/1EF8GsGXdr8hWN7ZwGZFiOT81LCJ+ddhdelNGKowVzT3mbkNYkpRfo2F /dLTYTVNDX/asTHzUZ+AtlDytIorQz6uCnxj7MPQt+eslkDyt31Owpnck97W53KKiy1z s+GQ== X-Gm-Message-State: AC+VfDw8vjwoVnW4Ctj/j7vLvhGdGZtx8HBHlH1jZdr6LXX9r5i9aJDO MBkXa18j5GBvUE0Oto1qnmM= X-Google-Smtp-Source: ACHHUZ47DkW9SM745FrraK1r5xDJl5cg3mgrSdhk7KVpjJTL8Hajcw6xW9Jtossi23C3CLQguRvcoA== X-Received: by 2002:a17:902:b608:b0:1b5:25bd:df2b with SMTP id b8-20020a170902b60800b001b525bddf2bmr82804pls.14.1687547646882; Fri, 23 Jun 2023 12:14:06 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id c2-20020a170902d90200b001b0499bee05sm7500673plz.191.2023.06.23.12.14.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Jun 2023 12:14:06 -0700 (PDT) Message-ID: <29634b43-4d4d-7f94-d2ad-08ea2f5f79ae@gmail.com> Date: Fri, 23 Jun 2023 13:14:04 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE} Content-Language: en-US To: juzhe.zhong@rivai.ai, gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, richard.sandiford@arm.com References: <20230623140537.4156063-1-juzhe.zhong@rivai.ai> From: Jeff Law In-Reply-To: <20230623140537.4156063-1-juzhe.zhong@rivai.ai> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 6/23/23 08:05, juzhe.zhong@rivai.ai wrote: > From: Ju-Zhe Zhong > > gcc/ChangeLog: > > * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}. > > --- > gcc/tree-ssa-loop-ivopts.cc | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc > index 6671ff6db5a..2b66fe66bc7 100644 > --- a/gcc/tree-ssa-loop-ivopts.cc > +++ b/gcc/tree-ssa-loop-ivopts.cc > @@ -2442,6 +2442,7 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p) > case IFN_MASK_LOAD: > case IFN_MASK_LOAD_LANES: > case IFN_LEN_LOAD: > + case IFN_LEN_MASK_LOAD: > if (op_p == gimple_call_arg_ptr (call, 0)) > return TREE_TYPE (gimple_call_lhs (call)); > return NULL_TREE; > @@ -2449,8 +2450,11 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p) > case IFN_MASK_STORE: > case IFN_MASK_STORE_LANES: > case IFN_LEN_STORE: > + case IFN_LEN_MASK_STORE: > if (op_p == gimple_call_arg_ptr (call, 0)) > - return TREE_TYPE (gimple_call_arg (call, 3)); > + return TREE_TYPE ( > + gimple_call_arg (call, internal_fn_stored_value_index ( > + gimple_call_internal_fn (call)))); Formatting nit. Compute the result of internal_fn_stored_value_index into a temporary and pass that temporary into gimple_call_arg which should clean up the formatting here. In general, if you find yourself indenting after an open paren like you've done here, compute the value into a temporary. OK with the formatting fix. jeff