From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 268783856DD0; Wed, 17 May 2023 14:04:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 268783856DD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684332257; bh=8KwrwHs7p53ywBrjH9cRmd2KQeU61QfVu/ZZJfq2kno=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EzT+zrGAXKn9n1s7kJzwOdmyM+YrNwB07f5EOnQeh1oMv7fdQ/WYEnU2KTAAUNgTx MpCxhvY+BZUAjA6JbEoJui2nZ13/ko8v/Wxl3mM1LNGKwf4IYU5IUocO+G7SqRN8NJ y21ku1tYmpsiH4LAwU5HRPXU6MDuo1bUKhjrDsC0= From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109811] libjxl 0.7 is a lot slower in GCC 13.1 vs Clang 16 Date: Wed, 17 May 2023 14:04:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109811 --- Comment #8 from Jan Hubicka --- Created attachment 55101 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55101&action=3Dedit hottest loop jpegxl build machinery adds -fno-vectorize and -fno-slp-vectorize to clang flags. Adding -fno-tree-vectorize -fno-tree-slp-vectorize makes GCC genera= ted code more similar. With this most difference is caused by FindBestPatchDictionary or FindTextLikePatches if that function is not inli= ned. 15.22% cjxl libjxl.so.0.7.0 [.] jxl::(anonymous namespace)::FindTextLikePatches=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 10.19% cjxl libjxl.so.0.7.0 [.] jxl::FindBestPatchDictionary= =20=20=20=20=20=20=20 5.27% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::QuantizeBlockAC= =20=20=20=20=20=20=20 5.06% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::EstimateEntropy= =20=20=20=20=20=20=20 4.82% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::EstimateEntropy= =20=20=20=20=20=20=20 4.35% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::QuantizeBlockAC= =20=20=20=20=20=20=20 4.21% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::(anonymous namespace)::TransformFromPixels=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 3.87% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::(anonymous namespace)::TransformFromPixels=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 3.78% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::FindBestMultiplie= r=20=20=20=20 3.27% cjxl libjxl.so.0.7.0 [.] jxl::N_AVX2::FindBestMultiplie= r=20=20=20=20 I think it is mostly register allocation not handling well the internal loop quoted above. I am adding preprocessed sources.=