From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 837B33858C66; Sat, 27 May 2023 18:01:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 837B33858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685210493; bh=IT0kjeKDk2yIuH5sUG2mbYpABiqYs/G/V83+kEXdDgo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dol/7TBj9m3b0LPOnKAp0Ax/rFzFdRGwWGt4X2Ftm4HF10/99YaiRDSwvdWuLnzlG RI/+Nazi2IPn0Nd9PAlWj1mG0rNrb5auOeqOW3S4bOx81NkjGgE1X/DGTckNT/Rmjf sSj3bNalPxzKYRQVBUK9dyJcdd0w1BXtNg5l9RAA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBjLzExMDAwN10gSW1wbGVtZW50IHN1cHBvcnQgZm9yIENs?= =?UTF-8?B?YW5n4oCZcyBfX2J1aWx0aW5fdW5wcmVkaWN0YWJsZSgp?= Date: Sat, 27 May 2023 18:01:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org 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=3D110007 --- Comment #2 from Andrew Pinski --- (In reply to Richard Yao from comment #0) > Having the ability to specify __builtin_unpredictable() as a hint to > encourage the compiler to use cmov would be useful for implementing > algorithms like binary search that have unpredictable branches. > __builtin_expect_with_probability() looks like a possible substitute, but > Clang does not support it and it does not always work as described in > #110001. PR 110001 has nothing to do with __builtin_expect_with_probability and __builtin_expect_with_probability will do exactly the same as __builtin_unpredictable will do really.=