[llvm] [EarlyIfConversion] Limit critical-path growth for strongly biased branches (PR #228709)

Jonathan Cohen via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 02:47:50 PDT 2026


=?utf-8?q?Dávid_Bolvanský?= <david.bolvansky at gmail.com>,
=?utf-8?q?Dávid_Bolvanský?= <david.bolvansky at gmail.com>,
=?utf-8?q?Dávid_Bolvanský?= <david.bolvansky at gmail.com>,
=?utf-8?q?Dávid_Bolvanský?= <david.bolvansky at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/228709 at github.com>


jcohen-apple wrote:

> Even after adding an unlikely hint, the branch was still if-converted, adding selects to a loop-carried dependency.

That might be the key here then. Taking a narrow view of the edge probability doesn't address the core issue of if-conversion serializing a loop carried dependency. If you keep the branch the core can execute loop iterations in parallel speculatively, but once you introduce a select you serialize the execution, which is why the performance is worse.

https://github.com/llvm/llvm-project/pull/228709


More information about the llvm-commits mailing list