From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 9791A3870863 for ; Tue, 25 Jun 2024 15:15:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9791A3870863 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9791A3870863 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719328537; cv=none; b=N5B1UaRX7MBhSl3uKGJzvVhBc6a4U/oiyNy0W7AGk93vY45gMTOOKJkEUA2kuhl54sI5r+kujtahYZ2Vd1/MlEkxxjSyqT74W1BTMxX3X9Wuw8GyyfCpaa/rLIR1cZgQjcMU1qNgnaxMF3FkL1ZVi3MonNSCEHHCzpGK6/k5dMA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719328537; c=relaxed/simple; bh=nQKrpixHp+ZyB/DlGsnaRNf3PaojTzlQFK+G7eM3j3k=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=lb4YR1JCatVovaypi9E1EVifHGVaX3EqlAzGVUYQ2BYKG3yNW23ge5lK93Trvarv61V/xkQZ75grz8h/vpoNwui21LjnMRTHveEZ6zg449EyaH08ynIi5bpLVtxXRx5uEm5KbQMYtKLGiAwW4wz4TSfIR1pXdGxf4jWxqzAl0gc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DB14D339; Tue, 25 Jun 2024 08:15:59 -0700 (PDT) Received: from [10.2.78.57] (e120077-lin.cambridge.arm.com [10.2.78.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 973A13F766; Tue, 25 Jun 2024 08:15:34 -0700 (PDT) Message-ID: Date: Tue, 25 Jun 2024 16:15:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm: make arm_predict_doloop_p reject loops with calls To: "Andre Vieira (lists)" , "gcc-patches@gcc.gnu.org" References: <7d96577f-6d5c-40e3-9fe6-14c82031a2fa@arm.com> From: "Richard Earnshaw (lists)" Content-Language: en-GB In-Reply-To: <7d96577f-6d5c-40e3-9fe6-14c82031a2fa@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3489.5 required=5.0 tests=BAYES_00,BODY_8BITS,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,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 25/06/2024 12:53, Andre Vieira (lists) wrote: > Hi, > > With the introduction of low overhead loops in https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3dfc28dbbd21b1d708aa40064380ef4c42c994d7 we defined arm_predict_doloop_p, this is meant to be a low-weight check to rule out loops we are not considering for doloop optimization and it is used by other passes to prevent optimizations that may hurt the doloop optimization later on. The reason these are meant to be lightweight is because it's used by pre-RTL optimizations, meaning we can't do the same checks that doloop does. > > After the definition of arm_predict_doloop_p, when testing for armv8.1-m.main, tree-ssa/ivopts-3.c failed the scan-dump check as the dump now matched an extra '!= 0' introduced by: > Doloop cmp iv use: if (ivtmp_1 != 0) > Predict loop 1 can perform doloop optimization later. > > where previously we had: > Predict doloop failure due to target specific checks. > > and after this patch: > Predict doloop failure due to call in loop. > Predict doloop failure due to target specific checks. > > Added a copy of the original tree-ssa/ivopts-3.c as a target specifc test to check for the new dump message. > > Ran a regression test for arm-none-eabi with -march=armv8.1-m.main+mve/-mfpu=auto/-mthumb/-mfloat-abi=hard. > > OK for trunk? > > gcc/ChangeLog: > >         * confir/arm/arm.cc (arm_predict_doloop_p): Reject loops with function calls that are not builtins. > > gcc/testsuite/ChangeLog: > >         * gcc.target/arm/mve/ivopts-3.c: New test. OK. R.