llvm-project
9e4dddcc - [SimplifyCFG] Allow phi folding for boolean logic over non-equality (#185124)

Commit
1 day ago
[SimplifyCFG] Allow phi folding for boolean logic over non-equality (#185124) Phi folding is suppressed over binary operation inputs in order to avoid interfering with switch formation. After #183692, code (for example, Rust's ASCII character classification) may get an `or` hoisted up into it, which suppresses `foldTwoEntryPHINode`. This then produces branching code where previously we generated straightline code. To maintain switch formation while preventing any binops from breaking phi folding, restrict the scenario in which Phi folding is suppressed to binops of *equality* ops. This should mesh with switch statements, which require an explicit list of values, while not breaking optimization over > / < etc. which would never have been promoted to switches in the first place. Fixes: rust-lang/rust#153504
Author
Parents
Loading