fix: move structProjCases pass before extendJoinPointContext (#8752)
This PR fixes an issue where the `extendJoinPointContext` pass can lift join points containing projections to the top level, as siblings of `cases` constructs matching on other projections of the same base value. This prevents the `structProjCases` pass from projecting both at once, extending the lifetime of the parent value and breaking linearity at runtime. This would theoretically be possible to fix in `structProjCases`, but it would require some better infrastructure for handling join points. It's also likely that the IR passes dealing with reference counting would have similar bugs that pessimize the code. For this reason, the simplest thing is to just perform the `structProjCases` pass earlier, which prevents `extendJoinPointContext` from lifting these join points.
This commit is contained in:
parent
6a698c1c22
commit
8aa003bdfc
1 changed files with 1 additions and 1 deletions
|
|
@ -68,6 +68,7 @@ def builtinPassManager : PassManager := {
|
|||
toMono,
|
||||
simp (occurrence := 3) (phase := .mono),
|
||||
reduceJpArity (phase := .mono),
|
||||
structProjCases,
|
||||
extendJoinPointContext (phase := .mono) (occurrence := 0),
|
||||
floatLetIn (phase := .mono) (occurrence := 1),
|
||||
reduceArity,
|
||||
|
|
@ -78,7 +79,6 @@ def builtinPassManager : PassManager := {
|
|||
lambdaLifting,
|
||||
extendJoinPointContext (phase := .mono) (occurrence := 1),
|
||||
simp (occurrence := 5) (phase := .mono),
|
||||
structProjCases,
|
||||
cse (occurrence := 2) (phase := .mono),
|
||||
saveMono, -- End of mono phase
|
||||
extractClosed
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue