Skip to content

Commit ac02871

Browse files
krzysz00gysit
andauthored
Apply style nits from review
Co-authored-by: Tobias Gysi <[email protected]>
1 parent b6d28d1 commit ac02871

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,25 +215,24 @@ static LogicalResult setDereferenceableAttr(const llvm::MDNode *node,
215215
return success();
216216
}
217217

218-
/// Convert the given MMRA metadata (either an MMRA tag or an array of rhem)
218+
/// Convert the given MMRA metadata (either an MMRA tag or an array of them)
219219
/// into corresponding MLIR attributes and set them on the given operation as a
220220
/// discardable `llvm.mmra` attribute.
221221
static LogicalResult setMmraAttr(llvm::MDNode *node, Operation *op,
222222
LLVM::ModuleImport &moduleImport) {
223223
llvm::MMRAMetadata wrapper(node);
224-
if (wrapper.empty()) {
224+
if (wrapper.empty())
225225
return success();
226-
}
226+
227227
MLIRContext *ctx = op->getContext();
228228
Attribute mlirMmra;
229229
if (wrapper.size() == 1) {
230230
auto [prefix, suffix] = *wrapper.begin();
231231
mlirMmra = LLVM::MMRATagAttr::get(ctx, prefix, suffix);
232232
} else {
233233
SmallVector<Attribute> tags;
234-
for (auto [prefix, suffix] : wrapper) {
234+
for (auto [prefix, suffix] : wrapper)
235235
tags.push_back(LLVM::MMRATagAttr::get(ctx, prefix, suffix));
236-
}
237236
mlirMmra = ArrayAttr::get(ctx, tags);
238237
}
239238
op->setAttr(LLVMDialect::getMmraAttrName(), mlirMmra);

mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ amendOperationImpl(Operation &op, ArrayRef<llvm::Instruction *> instructions,
735735
if (auto oneTag = dyn_cast<LLVM::MMRATagAttr>(attribute.getValue())) {
736736
tags.emplace_back(oneTag.getPrefix(), oneTag.getSuffix());
737737
} else if (auto manyTags = dyn_cast<ArrayAttr>(attribute.getValue())) {
738-
for (auto a : manyTags) {
738+
for (Attribute attr : manyTags) {
739739
auto tag = dyn_cast<MMRATagAttr>(a);
740740
if (tag) {
741741
tags.emplace_back(tag.getPrefix(), tag.getSuffix());
@@ -754,9 +754,8 @@ amendOperationImpl(Operation &op, ArrayRef<llvm::Instruction *> instructions,
754754
// Empty list, canonicalizes to nothing
755755
return success();
756756
}
757-
for (llvm::Instruction *inst : instructions) {
757+
for (llvm::Instruction *inst : instructions)
758758
inst->setMetadata(llvm::LLVMContext::MD_mmra, mmraMd);
759-
}
760759
return success();
761760
}
762761
return success();

0 commit comments

Comments
 (0)