-
Notifications
You must be signed in to change notification settings - Fork 366
[LLHD] Remove drive-only signals in Sig2Reg pass #8629
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
Conversation
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.
LGTM. Could you add this as canonicalization as well in a follow-up?
})) { | ||
LLVM_DEBUG(llvm::dbgs() << " - Removing drive-only signal " | ||
<< sigOp.getName() << "\n"); | ||
for (auto *user : sigOp->getUsers()) |
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 early increment is necessary
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.
Nice catch, thanks! 👍
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.
LGTM!
Could you add this as canonicalization as well in a follow-up?
This pass currently assumes that you don't care about tracking signals by their name afterward (e.g., in simulation). I don't think we want this by default in canonicalization. We might even want to add an option to this pass to insert hw.wire
or similar operations to the promoted SSA values to keep the name references in the future.
@uenoku @maerhart Do you remember what our stance was on canonicalizer complexity? Replacing signals with the driven value would be nice to have as a canonicalization, but I remember discussing that walking all users of an op in a canonicalizer might be too costly -- is that a "policy" we settled on? |
Extend the Sig2Reg LLHD pass to completely remove a signal and all its associated drives if the signal is only driven, but never probe or used in any other way.
17ae22b
to
1ec6a13
Compare
Extend the Sig2Reg LLHD pass to completely remove a signal and all its associated drives if the signal is only driven, but never probe or used in any other way.
Extend the Sig2Reg LLHD pass to completely remove a signal and all its associated drives if the signal is only driven, but never probe or used in any other way.