From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13380385C6F2; Fri, 1 Dec 2023 09:25:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13380385C6F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701422732; bh=FIjr9oBAwlGSKQj4GZqlpW4OHFirvKoDyJpaxImgEK4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Qd+69f5hSX3Hxvf+SoC1Cn6/1c/PepjWUmyvs6RwgNJg32oRQi5C2iI942fpzmrco KE/Glw6dXR0eBaURM2roBGmiEiby0z68L9KOTQl64qA0EkPnsLFZkZErZFtK//qb3i NenCSPCVIFd8AnWqUfjBuZ7LR3bDo+KwLFJSNbM8= From: "zamazan4ik at tut dot by" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/112806] Profile-Guided Optimization (PGO) policy regarding explicit user optimization hint behavior Date: Fri, 01 Dec 2023 09:25:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: unknown X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: zamazan4ik at tut dot by X-Bugzilla-Status: UNCONFIRMED 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: 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=3D112806 --- Comment #3 from Alexander Zaitsev --- > https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Other-Builtins.html#index-f= profile-arcs-1 I already read this and still do not understand the actual behavior. If PGO profiles show that the branch is "cold" but a user write for this branch via __builtin_expect/[[likely]] that the branch is "hot" - what decision will be made by the optimizer? On the link above there is only "In general, you should prefer to use actual profile feedback for this (-fprofile-arcs), as programmers are notoriously = bad at predicting how their programs actually perform.". But it does not specify the actual behavior - it's just a recommendation to use PGO instead of manu= al [[likely]] hints.=