[all-commits] [llvm/llvm-project] c4763e: [profcheck][InstCombine] Preserve branch weights i...
Alan Zhao via All-commits
all-commits at lists.llvm.org
Mon Nov 3 09:33:03 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c4763e2b9038fbd1154f0276a8b9542b8c115111
https://github.com/llvm/llvm-project/commit/c4763e2b9038fbd1154f0276a8b9542b8c115111
Author: Alan Zhao <ayzhao at google.com>
Date: 2025-11-03 (Mon, 03 Nov 2025)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
M llvm/test/Transforms/InstCombine/select-safe-transforms.ll
M llvm/utils/profcheck-xfail.txt
Log Message:
-----------
[profcheck][InstCombine] Preserve branch weights in logical identities (#165810)
For the simplification
```
(C && A) || (!C && B) --> sel C, A, B
```
(and related), if `C` (or (`!C`)) is the condition in the select
instruction representing the logical and, we can preserve that logical
and's branch weights when emitting the new instruction. Otherwise, the
profile data is unknown.
If `C` is the condition of both logical ands, then we just take the
branch weights of the first logical and (though in practice they should
be equal.)
Furthermore, `select-safe-transforms.ii` now passes under the profcheck
configuration, so we remove it from the failing tests.
Tracking issue: #147390
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list