Skip to content

Commit a99d666

Browse files
authored
[MLIR][OpenMP] Replace index-based loop (NFC) (llvm#107878)
1 parent edbe8fa commit a99d666

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,14 +3428,12 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
34283428
llvmOutlinedFn->addFnAttr(attr);
34293429

34303430
builder.restoreIP(codeGenIP);
3431-
unsigned argIndex = 0;
3432-
for (auto &mapOp : mapVars) {
3431+
for (auto [argIndex, mapOp] : llvm::enumerate(mapVars)) {
34333432
auto mapInfoOp = cast<omp::MapInfoOp>(mapOp.getDefiningOp());
34343433
llvm::Value *mapOpValue =
34353434
moduleTranslation.lookupValue(mapInfoOp.getVarPtr());
34363435
const auto &arg = targetRegion.front().getArgument(argIndex);
34373436
moduleTranslation.mapValue(arg, mapOpValue);
3438-
argIndex++;
34393437
}
34403438
llvm::BasicBlock *exitBlock = convertOmpOpRegions(
34413439
targetRegion, "omp.target", builder, moduleTranslation, bodyGenStatus);

0 commit comments

Comments
 (0)