Skip to content
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

[RTG] Add ElaborationPass #7876

Open
wants to merge 1 commit into
base: maerhart-rtg-test-and-target
Choose a base branch
from

Conversation

maerhart
Copy link
Member

Add a pass that lowers the random parts of RTG IR.

@maerhart maerhart added the RTG Involving the `rtg` dialect label Nov 22, 2024
@maerhart maerhart force-pushed the maerhart-rtg-elaboration-pass branch from 36dfd4c to 2633cab Compare November 22, 2024 17:43
Copy link
Member

@youngar youngar left a comment

Choose a reason for hiding this comment

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

Will keep looking tomorrow, its looking great! 😁

docs/Dialects/RTG.md Show resolved Hide resolved
include/circt/Dialect/RTG/Transforms/RTGPasses.h Outdated Show resolved Hide resolved
lib/Dialect/RTG/Transforms/ElaborationPass.cpp Outdated Show resolved Hide resolved
Comment on lines +515 to +516
newTest.setSymName(test.getSymName().str() + "_" +
target.getSymName().str());
Copy link
Member

Choose a reason for hiding this comment

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

Could this cause a name collision? You can use the SymbolTable to help generate unique symbols

lib/Dialect/RTG/Transforms/ElaborationPass.cpp Outdated Show resolved Hide resolved
Comment on lines 503 to 505
// If the test requries nothing from a target, we can always run it.
if (test.getTarget().getEntryTypes().empty())
continue;
Copy link
Member

Choose a reason for hiding this comment

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

So if a test does not have any requirements we won't run it on each target, just once in general?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two things to consider:

  1. The unelaborated test is the same for all targets, so do we want to randomize it once for each target or randomize it once and use that for each target? If the latter, then we don't have to copy it. But I guess the earlier approach would be the more consistent one, right?
  2. Currently I assume that all tests for all targets will be run on the same system because there is no way to distinguish them after this pass. If we want to have targets for different systems in the same MLIR file, we'd need some scoping, add the target that the test specialized for as an attribute, or some other way to distinguish them. As long as we don't do that, we don't need to duplicate a test that has the same content.

I guess I will change it to be copied and independently randomized for each target, but leave point 2 for a future PR.

Copy link
Member

@youngar youngar Nov 26, 2024

Choose a reason for hiding this comment

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

I don't really know whats best, what you had originally is probably good! We can revisit these points in the future easily enough.

test/Dialect/RTG/Transform/elaboration.mlir Outdated Show resolved Hide resolved
lib/Dialect/RTG/Transforms/ElaborationPass.cpp Outdated Show resolved Hide resolved
@maerhart maerhart force-pushed the maerhart-rtg-test-and-target branch 3 times, most recently from 506937f to 14a434c Compare November 26, 2024 13:04
@maerhart maerhart force-pushed the maerhart-rtg-elaboration-pass branch from 2633cab to b89ad7c Compare November 26, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RTG Involving the `rtg` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants