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

[NewOptimizer] Backport reverse affinity changes from #26778 #26918

Merged
merged 1 commit into from
May 1, 2018

Conversation

Keno
Copy link
Member

@Keno Keno commented Apr 27, 2018

In #26778, I changed the way that the reverse affinity flag works
in order to support node insertion during compaction. In particular,
I had originally (for ease of implementation primarily) had that flag
simply change which BB an inserted node belongs to (i.e. if that flag
was set and there was a basic block boundary at the insertion site,
the new node would belong to the previous BB). In #26778, I changed
this to instead be a flag of whether to insert before or after a given
instruction. As it turns out, this change is also required for correctness.
Because domsorting can change the notion of "previous instruction" by
moving basic blocks, we had (in rare circumstances) instructions end
up in the wrong BB. Backporting those changes fixes that.

@Keno Keno mentioned this pull request Apr 27, 2018
18 tasks
line::Int
end
function NewNode(nnode::NewNode; pos=nnode.pos, attach_after=nnode.attach_after,
typ=nnode.typ, node=nnode.node, line=nnode.line)
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use kwargs in inference. don't make kwargs of types. especially don't make kwargs of nodes

node = renumber_ssa!(isa(entry.node, PhiNode) ?
rename_phinode_edges(entry.node, 0, result_order, bb_rename) : entry.node,
inst_rename, true)
) for entry in ir.new_nodes]
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't capture variables with a closure

In #26778, I changed the way that the reverse affinity flag works
in order to support node insertion during compaction. In particular,
I had originally (for ease of implementation primarily) had that flag
simply change which BB an inserted node belongs to (i.e. if that flag
was set and there was a basic block boundary at the insertion site,
the new node would belong to the previous BB). In #26778, I changed
this to instead be a flag of whether to insert before or after a given
instruction. As it turns out, this change is also required for correctness.
Because domsorting can change the notion of "previous instruction" by
moving basic blocks, we had (in rare circumstances) instructions end
up in the wrong BB. Backporting those changes fixes that.
@ararslan ararslan added the compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) label Apr 27, 2018
@Keno
Copy link
Member Author

Keno commented May 1, 2018

I need to base a bunch of other branches on top of this, so I'll merge this. I'll take further comments in post-commit review.

@Keno Keno merged commit 23388ae into master May 1, 2018
@vtjnash vtjnash deleted the kf/reverseaffinity branch May 1, 2018 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants