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

[LowerTypes][NFC] Minor touchups. #5050

Merged
merged 3 commits into from
Apr 14, 2023
Merged
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
14 changes: 6 additions & 8 deletions lib/Dialect/FIRRTL/Transforms/LowerTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ struct TypeLoweringVisitor : public FIRRTLVisitor<TypeLoweringVisitor, bool> {
FIRRTLType srcType, FlatBundleFieldEntry field);

PreserveAggregate::PreserveMode
getPreservatinoModeForModule(FModuleLike moduleLike);
getPreservationModeForModule(FModuleLike moduleLike);
Value getSubWhatever(Value val, size_t index);

size_t uniqueIdx = 0;
Expand Down Expand Up @@ -456,7 +456,7 @@ struct TypeLoweringVisitor : public FIRRTLVisitor<TypeLoweringVisitor, bool> {
/// Return aggregate preservation mode for the module. If the module has a
/// scalarized linkage, then we may not preserve it's aggregate ports.
PreserveAggregate::PreserveMode
TypeLoweringVisitor::getPreservatinoModeForModule(FModuleLike module) {
TypeLoweringVisitor::getPreservationModeForModule(FModuleLike module) {
auto lookup = conventionTable.find(module);
if (lookup == conventionTable.end())
return aggregatePreservationMode;
Expand Down Expand Up @@ -761,7 +761,7 @@ bool TypeLoweringVisitor::lowerArg(FModuleLike module, size_t argIndex,
// Flatten any bundle types.
SmallVector<FlatBundleFieldEntry> fieldTypes;
auto srcType = newArgs[argIndex].type.cast<FIRRTLType>();
if (!peelType(srcType, fieldTypes, getPreservatinoModeForModule(module)))
if (!peelType(srcType, fieldTypes, getPreservationModeForModule(module)))
return false;

for (const auto &field : llvm::enumerate(fieldTypes)) {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ bool TypeLoweringVisitor::visitDecl(InstanceOp op) {
SmallVector<Attribute> newNames;
SmallVector<Attribute> newPortAnno;
PreserveAggregate::PreserveMode mode =
getPreservatinoModeForModule(op.getReferencedModule(symTbl));
getPreservationModeForModule(op.getReferencedModule(symTbl));

endFields.push_back(0);
for (size_t i = 0, e = op.getNumResults(); i != e; ++i) {
Expand Down Expand Up @@ -1515,8 +1515,6 @@ void LowerTypesPass::runOnOperation() {
ops.push_back(module);
}

LLVM_DEBUG(llvm::dbgs() << "Recording Inner Symbol Renames:\n");

// This lambda, executes in parallel for each Op within the circt.
auto lowerModules = [&](FModuleLike op) -> LogicalResult {
auto tl =
Expand All @@ -1527,8 +1525,8 @@ void LowerTypesPass::runOnOperation() {
return LogicalResult::failure(tl.isFailed());
};

auto result = failableParallelForEach(&getContext(), ops.begin(), ops.end(),
lowerModules);
auto result = failableParallelForEach(&getContext(), ops, lowerModules);

if (failed(result))
signalPassFailure();
}
Expand Down