[Mlir-commits] [flang] [mlir] [flang][OpenMP] Fix reduction init region block management (PR #122079)

Tom Eccles llvmlistbot at llvm.org
Wed Jan 8 02:00:28 PST 2025


================
@@ -1039,9 +1039,6 @@ initReductionVars(OP op, ArrayRef<BlockArgument> reductionArgs,
   if (op.getNumReductionVars() == 0)
     return success();
 
-  llvm::IRBuilderBase::InsertPointGuard guard(builder);
-
-  builder.SetInsertPoint(latestAllocaBlock->getTerminator());
----------------
tblah wrote:

What worries me about removing this is that now the function is that now `initReductionVars` depends on what the current insertion point inside of the builder is.

It isn't obvious to me what the right insertion point for the builder should be when calling this function. Please could you document what assumptions `initReductionVars` is now making.

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


More information about the Mlir-commits mailing list