-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimizer: fix #43254, avoid infinite CFG traversal in SROA's dominat…
…ion analysis Since CFG can be cyclic, the previous implementation of `has_safe_def` that simply walks predecessors recursively was just wrong. This commit fixes it by making it `has_safe_def` maintain a single set that keeps the identities of basic blocks that have been examined already. This commit doesn't come with any sort of fancy tags that indicates a basic block is "being examined" or such, as opposed to inference, and thus this approach doesn't handle cycles very nicely. But still I don't see much motivation to make `has_safe_def` more accurate while keeping it correct, since it's called only in rare cases.
- Loading branch information
Showing
1 changed file
with
36 additions
and
17 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