Skip to content

[eagerly-elastic] Rewrites A and D with FTD - #1006

Open
emorbach wants to merge 25 commits into
mainfrom
emorbach/eagerly-elastic-AD
Open

[eagerly-elastic] Rewrites A and D with FTD#1006
emorbach wants to merge 25 commits into
mainfrom
emorbach/eagerly-elastic-AD

Conversation

@emorbach

@emorbach emorbach commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

This pass implements the two rewrites A and D from the eagerly elastic paper. Rewrite A pushes suppressors past operations and Rewrite D enables eager execution of loops with the help of a new "repeatingInitOp".
Before applying this pass, it is first necessary to run some form of FTD.

@emorbach
emorbach marked this pull request as ready for review July 9, 2026 15:09
@Jiahui17

Copy link
Copy Markdown
Member

Just a quick comment:

I think in general we could rename rewriteA to pushSuppressorsPastOperations (similarly for other rewrites) as much as possible to make the other reader's life easier... You could definitely add a remark that says this is "rewrite A from paper XXX" but the informative name comes first

@murphe67 murphe67 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey Elena! Thank you very much for this very high-quality pull request. I didn't review quite all of it, because I think I have given you enough to think about that you can extrapolate from 😁

This code is presented beautifully on the communication level and was very enjoyable to read, so thank you very much for that 😁

I think for all of this rewriting we need to hammer out some philosophical details about exactly what the input IR looks like and how things get divided up, so we get a super stable logical foundation to build on- I think you probably have some super useful info for me based on your experience with this, so we can discuss nicely in our meeting later.

Thanks again!! 😁 👍

Comment thread data/rtl-config-vhdl.json Outdated
Comment thread experimental/lib/Transforms/EagerlyElastic/EagerlyElasticAD.cpp Outdated
Comment thread experimental/lib/Transforms/EagerlyElastic/EagerlyElasticAD.cpp Outdated
Comment thread experimental/lib/Transforms/EagerlyElastic/EagerlyElasticAD.cpp Outdated
Comment thread experimental/lib/Transforms/EagerlyElastic/EagerlyElasticAD.cpp Outdated
Comment thread experimental/lib/Transforms/EagerlyElastic/EagerlyElasticAD.cpp Outdated
bool currentInverted = false, siblingInverted = false;
Value currentRoot = getForkTop(currentCond, currentInverted);
Value siblingRoot =
getForkTop(siblingBranch.getConditionOperand(), siblingInverted);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

handling two nots by passing through both of them and then returning "not inverted" seems a little bit messy- when does this happen?

it feels like this code might be course-correcting for the nots being handled weirdly rather than this being necessary in an elegant way? but I am not 100% sure.

Comment thread experimental/lib/Transforms/EagerlyElastic/EagerlyElasticAD.cpp Outdated
/// Move the suppressors past the following operation, targetOp. Erase all the
/// suppressors going into targetOp and create new suppressors on every output
/// of targetOp.
void EagerlyElasticADPass::performSuppressorMotion(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this taking a branch op seems strange to me on the logical level?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i think it's cleaner to get the condition if we also have one of the suppressors that will be moved

// create inverted condition
Value condition = branchOp.getConditionOperand();
Location loc = branchOp.getLoc();
auto invertedCondition = builder.create<handshake::NotIOp>(loc, condition);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

doesn't this bring up a complaint about depreciation when you build? should be NotIOp::build or something i think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

never had any issues with that, i use builder.create<> for all my operations...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants