[Mlir-commits] [mlir] 2f5477d - [MLIR][OpenMP] Add check for appropriate module operation during convertFlagsAttr
Andrew Gozillon
llvmlistbot at llvm.org
Thu Apr 27 07:24:03 PDT 2023
Author: Andrew Gozillon
Date: 2023-04-27T09:23:39-05:00
New Revision: 2f5477df95616c690e0bd049d340a6111ecbe28e
URL: https://github.com/llvm/llvm-project/commit/2f5477df95616c690e0bd049d340a6111ecbe28e
DIFF: https://github.com/llvm/llvm-project/commit/2f5477df95616c690e0bd049d340a6111ecbe28e.diff
LOG: [MLIR][OpenMP] Add check for appropriate module operation during convertFlagsAttr
Checks if the operation the attirbute resides on is an ModuleOp otherwise it fails.
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 52c075540e52..200f7d9b7701 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -1547,6 +1547,9 @@ convertOmpTargetData(Operation *op, llvm::IRBuilderBase &builder,
/// be passed as flags to the frontend, otherwise they are set to default
LogicalResult convertFlagsAttr(Operation *op, mlir::omp::FlagsAttr attribute,
LLVM::ModuleTranslation &moduleTranslation) {
+ if (!cast<mlir::ModuleOp>(op))
+ return failure();
+
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
ompBuilder->createGlobalFlag(
More information about the Mlir-commits
mailing list