-
Notifications
You must be signed in to change notification settings - Fork 0
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
Irreducible loops cleanup #257
Conversation
1936f87
to
db284b8
Compare
} | ||
|
||
|
||
private def processVisitedNodeOutgoingEdge(istate: State, edge: LoopEdge, DFSPpos: Int): State = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DFSPpos is never used, is there a reason it exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I just missed it in the refactor, its been moved into State.
thisLoop.reducible = false | ||
thisLoop.reentries += edge | ||
} | ||
private def traverse_loops_dfs(_istate: State, _b0: Block, _DFSPpos: Int): (State, Option[Block]) = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing actually uses the second output parameter, what is it for & what does it mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the Option[Block]
? I believe this is the first loop header following _b0, this is a holdover from the recursive style of the algorithm which traverses all the successors and tags block that is returned as a header. This still occurs in the state machine through the retval
variable. It is retained in the refactor so the type of the pseudo-return FinishProcessNode
state in the explicit call stack form matches the return value of the whole function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only time traverse_loops_dfs gets called, it has the tuple access ._1 at the end which only returns the State. Do we need to have this second output parameter at all? If there is some reason we want to keep it, there should be a comment documenting what it means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just removed it as it isn't really necessary.
This seems fine overall, I'll merge it in once those unused parameters are explained |
27b4c5e
to
db284b8
Compare
db284b8
to
7aaca91
Compare
# Conflicts: # src/main/scala/Main.scala # src/main/scala/util/BASILConfig.scala
Addresses #194 and #194
Refactors the analysis to be iterative rather than recursive, work over blocks rather than Commands, adds flow conditions and a cli flag to disable the analysis/transform.
It also factors out the algorithm's state from class members + mutable collections into an immutable case class, which I think makes the high level api a bit clearer, but the algorithm itself is probably more difficult to understand.