8000 [IMDCE] Remove dead hierpath and annotations in IMDCE by uenoku · Pull Request #5226 · llvm/circt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[IMDCE] Remove dead hierpath and annotations in IMDCE #5226

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

Merged
merged 4 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/circt/Dialect/FIRRTL/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def RemoveUnusedPorts : Pass<"firrtl-remove-unused-ports", "firrtl::CircuitOp">
];
}

def IMDeadCodeElim : Pass<"firrtl-imdeadcodeelim", "firrtl::CircuitOp"> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think hierpath are now in the circuit namespace.

Copy link
Member Author

Choose a reason for hiding this comment

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

I followed the implementation of InnerSymbolDCE that checks all uses of inner symbols not only within circuit op.

// Run on the top-level ModuleOp to include any VerbatimOps that aren't
// wrapped in a CircuitOp.
ModuleOp topModule = getOperation();

If it's assumed that there is no user of inner symbol outer circuit op, it makes sense to me to make these passes circuit op.

def IMDeadCodeElim : Pass<"firrtl-imdeadcodeelim", "mlir::ModuleOp"> {
let summary = "Intermodule dead code elimination";
let description = [{
This pass performs inter-module liveness analysis and deletes dead code
Expand Down
1 change: 1 addition & 0 deletions lib/Dialect/FIRRTL/Transforms/EmitOMIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ static std::optional<Attribute> scatterOMIR(Attribute original,
tracker.append("class", StringAttr::get(ctx, omirTrackerAnnoClass));
tracker.append("id", idAttr);
tracker.append("target", StringAttr::get(ctx, value));
tracker.append("type", StringAttr::get(ctx, tpe));

state.addToWorklistFn(DictionaryAttr::get(ctx, tracker));

Expand Down
Loading
0