From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by sourceware.org (Postfix) with ESMTPS id C33773858C83 for ; Sat, 5 Nov 2022 06:34:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C33773858C83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f178.google.com with SMTP id h193so6112895pgc.10 for ; Fri, 04 Nov 2022 23:34:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc: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=DmYT31DKcg29F7K4MPB3faMY+NqNsHP0fUHUj3SnPyU=; b=tSbegmxSbuRZNgOxowlA5xeBDR7NwI7dYhty3EZ2t1+dC5G/VZo1pAV9mdaROVueMq GI+bwkdpT67lAHRYicNycNKjvD0EM4P+nBkrl3tdqjUCuRyqiaJs9sMSqJVA99mAIRut x2MGz4x0coUlkfJ/fYHZwHdUS+hKltyV2KpyYey0uBmvaClPyvY6TO5R0ues9bI7M2OF bSR75wvRGg3clXjOGvV/xDo6SYvvN4iTyZkneM0zJUe0QzCyBznmYYvHcA/TvMZ53wKh 1FgJDFhME8Xz8ee50r1l1P1AeJ4VNqitxDUaeJ8Q2grXt79N3N44Jk1of0QGZlCNQTaK ag3g== X-Gm-Message-State: ACrzQf1ZgwnglaLt2i3xbFMemOURnuuASAfWxCcbg6t1Wdh7Sa1mOnWV Ykk9Drgvy1Y5Q+XCJSTvS810nRvQQj065v/QXms= X-Google-Smtp-Source: AMsMyM4Yrz3JuUHBbn6wJ7aJl1DkUxc/7Amv+4etR16dfkTg25rD10qCQdITBttRIbD8+ZTgsZ046kM5fi4KxC7FbwI= X-Received: by 2002:a63:66c3:0:b0:470:8fd:7bae with SMTP id a186-20020a6366c3000000b0047008fd7baemr15083493pgc.277.1667630066710; Fri, 04 Nov 2022 23:34:26 -0700 (PDT) MIME-Version: 1.0 References: <20220905214437.1275139-1-philipp.tomsich@vrull.eu> <23b39c10b30043318e05a5c44cc76591@huawei.com> In-Reply-To: <23b39c10b30043318e05a5c44cc76591@huawei.com> From: Andrew Pinski Date: Fri, 4 Nov 2022 23:34:14 -0700 Message-ID: Subject: Re: [PATCH] [PHIOPT] Add A ? B + CST : B match and simplify optimizations To: Zhongyunde Cc: "hongtao.liu@intel.com" , "gcc-patches@gcc.gnu.org" , "Zhangwen(Esan)" , "Weiwei (weiwei, Compiler)" , "zhong_1985624@163.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 Fri, Nov 4, 2022 at 11:17 PM Zhongyunde wrote: > > hi, > This patch is try to fix the issue https://gcc.gnu.org/bugzilla/show_bu= g.cgi?id=3D107190, > would you like to give me some suggestion, thanks. This seems like a "simplified" version of https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584411.html which just handles power of 2 constants where we know the cond will be removed. We could do even more "simplified" of 1 if needed really. What is the IR before PHI-OPT? Is it just + 1? Also your pattern can be simplified to use integer_pow2p in the match part instead of INTEGER_CST. Thanks, Andrew > > ~/source/gccUpstreamDir/gcc/testsuite(cfg) =C2=BB git format-patch -1 --s= tart-number=3D00 HEAD -o ~/patch > /home/zhongyunde/patch/0000-PHIOPT-Add-A-B-CST-B-match-and-simplify-optim= ization.patch