[llvm] [InstCombine] Preserve profile branch weights when folding logical booleans (PR #161293)

Alan Zhao via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 17:00:18 PDT 2025


alanzhao1 wrote:

> Nit: in your commit message, is it (A && B && C -> A && (B && C)), correct? (B && C not B & C)

It is supposed to be one ampersand (`B & C`) because we're converting a logical and to a bitwise and. See https://github.com/llvm/llvm-project/blob/18136c249610ce8bb1e4b2b543a605b1221730bd/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp#L3412-L3414

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


More information about the llvm-commits mailing list