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

Commit
32 days ago
[InstCombine] Preserve profile branch weights when folding logical booleans (#161293) Logical booleans in LLVM are represented by select statements - e.g. the statement ``` A && B ``` is represented as ``` select i1 %A, i1 %B, i1 false ``` When LLVM folds two of the same logical booleans into a logical boolean and a bitwise boolean (e.g. `A && B && C` -> `A && (B & C)`), the first logical boolean is a select statement that retains the original condition from the first logical boolean of the original statement. This means that the new select statement has the branch weights as the original select statement. Tracking issue: #147390
Author
Parents
Loading