From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 7860C3858406 for ; Sun, 31 Jul 2022 02:45:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7860C3858406 Received: by mail-pj1-x102b.google.com with SMTP id e8-20020a17090a280800b001f2fef7886eso8679775pjd.3 for ; Sat, 30 Jul 2022 19:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=0tlfzMo6WjoehSuCQdvdL2Ok9Vyomg4GY2DAFKDx684=; b=TlPcEKB/NiZJRlgcQvfZAoZjxUWQsOgU3XW9Iln+D5Yp+mEqoIRIvToDFqMU1iL4IU 5I0zRgRRKL6xVfSxniePZ+HRyeF9cNZB70PWPsB/AAc+kQ+jIuBVrhWxeYHog3UVztk/ 0KdtvssngRaNpPJsUzop9btostG6coA45P6GVG5mhqKb7iZvaNIjpyt2KFqA/21ZdYpb Z8gET/yldznVrlAvWMGDeSF8aGQ8fwBOhx+4bHi/rOCAQ0CNhZ5V5SMW30Rg/zPoWqro i2o3Sm9ObjStFB8sCv5MHJnJN76diSZRa9PYpRqdSlwdQLe2uPGDxJEXJO1aOI8kz4ph 7p9g== X-Gm-Message-State: ACgBeo3kIVYW7QGK7atVuhKKAoRaHvUyrLK1arXZCcMbkVsPcrK+qHyk Zxt0mrdh1SU5qtQwFQRo9F4XyEwISbU= X-Google-Smtp-Source: AA6agR7xT7u7Ylfg3CY0etjWMBtTKVrdjWTguBVev0S4SkhAD8QsjFm16Uue6VS0YqjEtxTKshod0w== X-Received: by 2002:a17:90b:4f8e:b0:1f4:ed30:d286 with SMTP id qe14-20020a17090b4f8e00b001f4ed30d286mr1739539pjb.66.1659235555991; Sat, 30 Jul 2022 19:45:55 -0700 (PDT) Received: from [172.31.0.204] (c-73-98-188-51.hsd1.ut.comcast.net. [73.98.188.51]) by smtp.gmail.com with ESMTPSA id n14-20020a170902f60e00b0016c4331e61csm6390456plg.137.2022.07.30.19.45.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Jul 2022 19:45:55 -0700 (PDT) Message-ID: Date: Sat, 30 Jul 2022 20:45:54 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] tree-optimization/106365 - DSE of LEN_STORE and MASK_STORE Content-Language: en-US To: gcc-patches@gcc.gnu.org References: <20220721090553.6DCFD13A1B@imap2.suse-dmz.suse.de> From: Jeff Law In-Reply-To: <20220721090553.6DCFD13A1B@imap2.suse-dmz.suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2022 02:45:58 -0000 On 7/21/2022 3:05 AM, Richard Biener via Gcc-patches wrote: > The following enhances DSE to handle LEN_STORE (optimally) and > MASK_STORE (conservatively). > > Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. > Kewen is testing on powerpc. Handling MASK_STORE_LANES in > a similar way to MASK_STORE is probably possible but I couldn't > figure a way to generate one for testing. STORE_LANES is > probably handled already since it's ECF_CONST. > > PR tree-optimization/106365 > * tree-ssa-dse.cc (initialize_ao_ref_for_dse): Handle > LEN_STORE, add mode to initialize a may-def and handle > MASK_STORE that way. > (dse_optimize_stmt): Query may-defs. Handle internal > functions LEN_STORE and MASK_STORE similar to how > we handle memory builtins but without byte tracking. LGTM.  Obviously if you can massage the PR into a testcase, it's even better :-) jeff