-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat!: track memory dependencies involving the block terminator #433
base: main
Are you sure you want to change the base?
Conversation
…o not show up in the dependency graph
|
#[error( | ||
"Error scheduling {}: {}: {variant:?}", | ||
match .instruction_node { | ||
None => "an instruction".to_string(), |
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'm wondering if we should just implement Display
here?
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.
Maybe? I'm always a bit reluctant to implement Display
for fragments like this that wouldn't make sense in every sentence
@@ -306,17 +316,28 @@ impl<'a> ScheduledBasicBlock<'a> { | |||
|
|||
let extern_signature_map = ExternSignatureMap::try_from(program.extern_pragma_map.clone()) | |||
.map_err(|(pragma, _)| ScheduleError { |
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 wouldn't hold you to this, but I probably should have made ScheduleError
into an enum
here; this variant would include the pragma rather than a None
for instruction_node
. That involves making downstream accommodations.
DECLARE depends_on_ro BIT | ||
NONBLOCKING CAPTURE 0 "ro_rx" flat(duration: 2.0000000000000003e-06, iq: 1.0, scale: 1.0, phase: 0.8745492960861506, detuning: 0.0) ro | ||
MOVE depends_on_ro ro |
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.
What happens here if depends_on_ro
is used in the next block? Is that supported? I would make a test case for that, regardless as to whether it's supported. If not supported, a failing test case, issue, and some documentation on the limitation would be nice.
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.
We only track dependencies within blocks because there's already a total ordering constraint between blocks; we don't do inter-block scheduling. (This is, AFAIK, already documented.) So it's not supported but because it's not really relevant. A test case is a fine idea, but I don't think it will fail and don't think there's an issue to create.
This PR adds the block terminator instruction to the analysis done by
ScheduledBasicBlock::build
, so that we correctly track its memory references when it's a conditional jump. This instruction is considered to live at the "index"ScheduledGraphNode::BlockEnd
.Concretely, this PR is for programs like the following (this is the test
program::scheduling::graph::graphviz_dot_tests::memory_dependency_in_block_terminator
):There ought to be an "await capture" edge from the
NONBLOCKING CAPTURE
to theJUMP-WHEN
.Previously, this program generated the following incorrect scheduled dependency graph, with no "await capture" edges at all (generated from DOT with
dot -Tpng -Gdpi=300 in.dot > out.png
):Now, it generates this more correct scheduled dependency graph, where the edge from the
NONBLOCKING CAPTURE
to the block end is labeled with "await capture" as well as "ordering" and "timing":The diff between the DOT of the two graphs is
The full DOT for the old, incorrect graph is:
The full DOT for the new graph is:
Closes #429