-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GuardWidening] Choose right point for generating wide condition for …
…branches. PR60234 When guards are represented as widenable branches, there is a tricky situation when the branch stays in loop but widenable condition doesn't. It means that the widenable condition is loop-invariant, and some other optimizations could have done changes using this fact. If widening is allowed to create widened condition inside this loop, and join the loop-invariant wc with some non-invariant facts, it can cause miscompile. See example of this at #60234. The solution is to adjust the point of generationg the wide condition, and therefore of hoisting all related parts there. It should not be before the branch, but before the widenable_condition call. The fact that `wc()` and the wide condition are in the same block guarantees that they will not violate the invariance property for any loop. Differential Revision: https://reviews.llvm.org/D142693 Reviewed By: apilipenko
- Loading branch information
Showing
5 changed files
with
51 additions
and
37 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
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
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
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
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