Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CFG corruption in CFG simplify #48962

Merged
merged 1 commit into from
Mar 10, 2023
Merged

Fix CFG corruption in CFG simplify #48962

merged 1 commit into from
Mar 10, 2023

Conversation

Keno
Copy link
Member

@Keno Keno commented Mar 10, 2023

IncrementalCompact ordinarily takes ownership of the CFG in order to to its transform. cfg_simplify! separate constructs the CFG transform structures ahead of time and was assuming this meant that the original CFG remained untouched (since it was using it for lookup operations). Unfortunately, the IncrementalCompact constructor was already doing some CFG manipulation cuasing the CFG to be corrupted and cfg_simplify! to create invalid IR. Fix that by refactoring the IncrementalCompact constructor to allow passing in the CFG transformation state explicitly, rather than poking it into the fields afterwards.

IncrementalCompact ordinarily takes ownership of the CFG in order to to its
transform. cfg_simplify! separate constructs the CFG transform structures
ahead of time and was assuming this meant that the original CFG remained
untouched (since it was using it for lookup operations). Unfortunately,
the IncrementalCompact constructor was already doing some CFG manipulation
cuasing the CFG to be corrupted and cfg_simplify! to create invalid IR.
Fix that by refactoring the IncrementalCompact constructor to allow
passing in the CFG transformation state explicitly, rather than poking
it into the fields afterwards.
@Keno Keno merged commit fd5b5e3 into master Mar 10, 2023
@Keno Keno deleted the kf/fixcfgsimpbug branch March 10, 2023 22:28
aviatesk added a commit that referenced this pull request Mar 17, 2023
`bb_rename_pred` was captured, so this commit fixes it up.
FWIW, `JET.report_opt(CC.batch_inline!,
  (CC.IRCode,Vector{Pair{Int,Any}},Bool,CC.OptimizationParams))`
successfully detected it.
vtjnash pushed a commit that referenced this pull request Mar 17, 2023
`bb_rename_pred` was captured by #48962, so this commit fixes it up.
This was successfully detected by:
`JET.report_opt(CC.batch_inline!, (CC.IRCode,Vector{Pair{Int,Any}},Bool,CC.OptimizationParams))`
oscardssmith pushed a commit to oscardssmith/julia that referenced this pull request Mar 20, 2023
…ang#49036)

`bb_rename_pred` was captured by JuliaLang#48962, so this commit fixes it up.
This was successfully detected by:
`JET.report_opt(CC.batch_inline!, (CC.IRCode,Vector{Pair{Int,Any}},Bool,CC.OptimizationParams))`
Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
IncrementalCompact ordinarily takes ownership of the CFG in order to to its
transform. cfg_simplify! separate constructs the CFG transform structures
ahead of time and was assuming this meant that the original CFG remained
untouched (since it was using it for lookup operations). Unfortunately,
the IncrementalCompact constructor was already doing some CFG manipulation
cuasing the CFG to be corrupted and cfg_simplify! to create invalid IR.
Fix that by refactoring the IncrementalCompact constructor to allow
passing in the CFG transformation state explicitly, rather than poking
it into the fields afterwards.
Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
…ang#49036)

`bb_rename_pred` was captured by JuliaLang#48962, so this commit fixes it up.
This was successfully detected by:
`JET.report_opt(CC.batch_inline!, (CC.IRCode,Vector{Pair{Int,Any}},Bool,CC.OptimizationParams))`
@oscardssmith oscardssmith added bugfix This change fixes an existing bug compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) labels Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants