[Mlir-commits] [mlir] [MLIR][OpenMP] Skip host omp ops when compiling for the target device (PR #85239)

Sergio Afonso llvmlistbot at llvm.org
Thu Mar 21 07:52:09 PDT 2024


================
@@ -3043,116 +3199,15 @@ LogicalResult OpenMPDialectLLVMIRTranslationInterface::convertOperation(
     LLVM::ModuleTranslation &moduleTranslation) const {
 
   llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
+  if (ompBuilder->Config.isTargetDevice()) {
+    if (isInternalTargetDeviceOp(op)) {
+      return convertInternalTargetOp(op, builder, moduleTranslation);
----------------
skatrak wrote:

Nit: Can't we remove `convertInternalTargetOp` and simplify logic here a bit?
```c++
if (ompBuilder->Config.isTargetDevice() && !isTargetDeviceOp(op))
  return convertNestedTargetOps(...);
return convertOperation(...);
```

https://github.com/llvm/llvm-project/pull/85239


More information about the Mlir-commits mailing list