[Mlir-commits] [mlir] 51297a7 - [MLIR][OpenMP][NFC] Minor code cleanup
Akash Banerjee
llvmlistbot at llvm.org
Thu Apr 27 06:49:40 PDT 2023
Author: Akash Banerjee
Date: 2023-04-27T14:49:32+01:00
New Revision: 51297a7a720c83f831b072df4666877673f87cfa
URL: https://github.com/llvm/llvm-project/commit/51297a7a720c83f831b072df4666877673f87cfa
DIFF: https://github.com/llvm/llvm-project/commit/51297a7a720c83f831b072df4666877673f87cfa.diff
LOG: [MLIR][OpenMP][NFC] Minor code cleanup
Cleanup how the IsBegin argument is passed and removed unnecessary variable.
Added:
Modified:
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index 624975341c3dc..52c075540e525 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -1424,7 +1424,6 @@ static LogicalResult
convertOmpTargetData(Operation *op, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) {
unsigned numMapOperands;
- bool mapperFunc = false;
llvm::Value *ifCond = nullptr;
int64_t deviceID = llvm::omp::OMP_DEVICEID_UNDEF;
SmallVector<Value> mapOperands;
@@ -1471,7 +1470,6 @@ convertOmpTargetData(Operation *op, llvm::IRBuilderBase &builder,
numMapOperands = enterDataOp.getMapOperands().size();
mapOperands = enterDataOp.getMapOperands();
mapTypes = enterDataOp.getMapTypes();
- mapperFunc = true;
return success();
})
.Case([&](omp::ExitDataOp exitDataOp) {
@@ -1532,11 +1530,11 @@ convertOmpTargetData(Operation *op, llvm::IRBuilderBase &builder,
if (isa<omp::DataOp>(op)) {
builder.restoreIP(ompBuilder->createTargetData(
ompLoc, builder.saveIP(), mapTypeFlags, mapNames, mapperAllocas,
- mapperFunc, deviceID, ifCond, processMapOpCB, bodyCB));
+ /*IsBegin=*/false, deviceID, ifCond, processMapOpCB, bodyCB));
} else {
builder.restoreIP(ompBuilder->createTargetData(
ompLoc, builder.saveIP(), mapTypeFlags, mapNames, mapperAllocas,
- mapperFunc, deviceID, ifCond, processMapOpCB));
+ isa<omp::EnterDataOp>(op), deviceID, ifCond, processMapOpCB));
}
if (failed(processMapOpStatus))
More information about the Mlir-commits
mailing list