Skip to content

Commit 4cdd257

Browse files
committed
add todo
1 parent 860bd59 commit 4cdd257

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,11 @@ initReductionVars(OP op, ArrayRef<BlockArgument> reductionArgs,
12911291
mapInitializationArgs(op, moduleTranslation, reductionDecls,
12921292
reductionVariableMap, i);
12931293

1294+
// TODO In some cases (specially on the GPU), the init regions may
1295+
// contains stack alloctaions. If the region is inlined in a loop, this is
1296+
// problematic. Instead of just inlining the region, handle allocations by
1297+
// hoisting fixed length allocations to the function entry and using
1298+
// stacksave and restore for variable length ones.
12941299
if (failed(inlineConvertOmpRegions(reductionDecls[i].getInitializerRegion(),
12951300
"omp.reduction.neutral", builder,
12961301
moduleTranslation, &phis)))

0 commit comments

Comments
 (0)