-
-
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 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. Since we still examine each predecessor recursively, this approach doesn't handle cycles very nicely (this commit doesn't come with any sort of fancy tags that indicates a basic block is "being examined", as opposed to inference). But 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