[flang-commits] [flang] [OpenMP][flang] Move `todo` for checking reduction support status on the GPU (PR #175172)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Mon Jan 19 02:42:37 PST 2026


================
@@ -598,26 +598,6 @@ DeclareRedType ReductionProcessor::createDeclareReductionHelper(
   genCombinerCB(builder, loc, type, op1, op2, isByRef);
 
   if (isByRef && fir::isa_box_type(valTy)) {
-    bool isBoxReductionSupported = [&]() {
-      auto offloadMod = llvm::dyn_cast<mlir::omp::OffloadModuleInterface>(
-          *builder.getModule());
-
-      // This check tests the implementation status on the GPU. Box reductions
-      // are fully supported on the CPU.
-      if (!offloadMod.getIsGPU())
----------------
skatrak wrote:

I gave this a quick look and it appears we lose the information we'd need in order to identify unknown or non-constant shapes, because `LLVMTypeConverter::convertSequenceType` skips these dims when lowering to the LLVM dialect.

So, I guess that, for the time being, what we could do is to outline this check into a helper function (e.g. `static void checkDeviceImplementationStatus()`) called by `FunctionFilteringPass::runOnOperation` and document it stating that it exclusively looks for target device-only TODOs that cannot be detected in the MLIR to LLVM IR translation stage.

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


More information about the flang-commits mailing list