[flang-commits] [flang] [flang] Fixed operations hoisting out of fir.do_concurrent. (PR #173502)
Théo Degioanni via flang-commits
flang-commits at lists.llvm.org
Fri Dec 26 14:44:07 PST 2025
================
@@ -262,8 +266,13 @@ class DoConcurrentConversion
rewriter, doConcurentOp->getParentOfType<mlir::ModuleOp>());
auto *allocIt = firBuilder.getAllocaBlock();
+ // Move alloca operations into the alloca-block, and all other
+ // operations - right before fir.do_concurrent.
for (mlir::Operation *op : llvm::reverse(opsToMove))
- rewriter.moveOpBefore(op, allocIt, allocIt->begin());
+ if (mlir::isa<fir::AllocaOp>(op))
----------------
Moxinilian wrote:
Yes! In principle you can attach it to any allocator, even ones with explicit freeing.
https://github.com/llvm/llvm-project/pull/173502
More information about the flang-commits
mailing list