[Mlir-commits] [mlir] [mlir][OpenMP] add missing load for reduction cleanup region (PR #88289)
Tom Eccles
llvmlistbot at llvm.org
Wed Apr 10 09:32:51 PDT 2024
================
@@ -889,8 +889,17 @@ static LogicalResult inlineReductionCleanup(
// map the argument to the cleanup region
Block &entry = cleanupRegion.front();
- moduleTranslation.mapValue(entry.getArgument(0),
- privateReductionVariables[i]);
+
+ llvm::Instruction *potentialTerminator =
+ builder.GetInsertBlock()->empty() ? nullptr
+ : &builder.GetInsertBlock()->back();
----------------
tblah wrote:
I was trying to be careful. The tests in this patch do have a terminator in the block already. This is roughly mirroring logic at https://github.com/llvm/llvm-project/blob/e161d1280a5e5db465abd256eee974a524daa4fa/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp#L412
https://github.com/llvm/llvm-project/pull/88289
More information about the Mlir-commits
mailing list