[flang-commits] [flang] [flang][cuda] Include constant extents in cuf.alloc size computation (PR #194288)
Valentin Clement バレンタイン クレメン via flang-commits
flang-commits at lists.llvm.org
Mon Apr 27 10:54:18 PDT 2026
================
@@ -206,6 +206,16 @@ struct CUFAllocOpConversion : public mlir::OpRewritePattern<cuf::AllocOp> {
rewriter, loc, nbElem,
builder.loadIfRef(loc, op.getShape()[i]));
}
+ fir::SequenceType::Extent constSize = 1;
+ for (auto extent : seqTy.getShape()) {
+ if (extent != fir::SequenceType::getUnknownExtent())
+ constSize *= extent;
+ }
+ if (constSize != 1)
----------------
clementval wrote:
Why not using the function directly?
https://github.com/llvm/llvm-project/pull/194288
More information about the flang-commits
mailing list