forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport CFG simplification pass from XLA backend
Right now we don't do too much CFG simplification (esp since we turned off doing so for constant folded branches). This isn't too much of a problem, because LLVM is very good at cutting down any excess basic block we happen to emit. However, for non-SSA backends, excess CFG can be a significant problem that the backend may not be able to optimize away (even if it's trivial at the Julia IR level). Plus it's annoying for humans to read. The XLA backend had a simple CFG simplification pass. Backport this pass to Base, so it can live alongside the code it depends on (it has a fairly close dependency on the details of the CFG and IncrementalCompact). As it stands, I don't think it's useful to have this pass in the default compiler pipeline (both because LLVM can handle it easily and because our round-trip to statement based representations cleans up some of this), but I do think it's useful interactively and for non-standard compiler backends. We should re-evaluate whether to put this in the standard compiler pipeline once we re-enable the CFG transformations of constant folded conditions. If that ends up leaving a lot of basic block chains around, it might yet be worth putting this in. Co-authored-by: Valentin Churavy <[email protected]>
- Loading branch information
Showing
5 changed files
with
238 additions
and
32 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
Oops, something went wrong.