[Mlir-commits] [flang] [llvm] [mlir] [Flang][OpenMP] Implement device clause lowering for target directive (PR #173509)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jan 5 13:16:45 PST 2026


================
@@ -340,7 +340,7 @@ static LogicalResult checkImplementationStatus(Operation &op) {
       result = todo("depend");
   };
   auto checkDevice = [&todo](auto op, LogicalResult &result) {
-    if (op.getDevice())
+    if (op.getDevice() && !isa<omp::TargetOp>(op))
----------------
chichunchen wrote:

I removed checkDevice from TargetOp and added it to TargetUpdateOp and TargetDataOp. I did not add checkDevice to TargetEnterDataOp or TargetExitDataOp, because doing so would cause regressions in [omptarget-llvm.mlir](https://github.hpe.com/hpcde/cce-cce/blame/master/mlir/test/Target/LLVMIR/omptarget-llvm.mlir). That test uses the device clause but hardcodes the device_id to -1 when calling the __tgt_target_enter_data and __tgt_target_exit_data APIs.

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


More information about the Mlir-commits mailing list