Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SimpleLoopUnswitch] Re-fix introduction of UB when hoisted condition…
… may be undef or poison https://bugs.llvm.org/show_bug.cgi?id=27506 https://bugs.llvm.org/show_bug.cgi?id=31652 https://bugs.llvm.org/show_bug.cgi?id=51043 Problems with SimpleLoopUnswitch cause the bug reports above. ``` while (...) { if (C) { A } else { B } } Into: C' = freeze(C) if (C') { while (...) { A } } else { while (...) { B } } ``` This problem can be solved by adding a freeze on hoisted branches(above transform) and has been solved by D29015. However, D29015 is now reverted by performance regression(2b5a897) It is not the first time that an added freeze has caused performance regression. SimplifyCFG also had a problem with UB caused by branching-on-undef, which was solved by adding freeze to the branching condition. (D104569) Performance regression occurred in D104569, and patches such as D105344 and D105392 were written to minimize it. This patch will correct the SimpleLoopUnswitch as D104569 handles the SimplyCFG while minimizing performance loss by introducing patches like D105344 and D105392(This patch was rebased with the author's permission) Reviewed By: reames Differential Revision: https://reviews.llvm.org/D106041
- Loading branch information
1 parent
bacb0ca
commit 0aeb373
Showing
2 changed files
with
2,359 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.