From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 42E10385142A; Thu, 19 May 2022 10:31:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42E10385142A From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/105643] [13 Regression] Code-Size regression for specrate 538.imagick_r Date: Thu, 19 May 2022 10:31:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 10:31:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105643 --- Comment #7 from Richard Biener --- It seems there are a lot of loops like the following in FrameImage for (x=3D0; x < (ssize_t) width; x++) { SetPixelPacket(frame_image,&matte,q,frame_indexes); q++; frame_indexes++; } and they are now vectorized with an alias runtime check and a vectorized epilogue. I'd say that's good. The "bad" is that we are unswitching all those loops twice: magick/decorate.c:605:25: optimized: Unswitching loop on condition: _1874 <= =3D 0.0 magick/decorate.c:605:25: optimized: Unswitching loop on condition: _1874 >= =3D 6.5535e+4 which means we have three copies to vectorize at least. Doesn't really explain your opt-info reports reporting :605 16 times. In fact, I don't see any vectorization with -march=3Dskylake-avx512 here (but I didn't use -funroll-loops which will only make a difference on RTL so generally I'd avoid that). Maybe I need to check with a compiler that doesn't have some unswitching improvements queued (but the old should = get those opportunities as well I think).=