[flang-commits] [flang] [Flang][OpenACC][OpenMP] Always add extent to acc/omp.BoundsOp (PR #73790)
Valentin Clement バレンタイン クレメン via flang-commits
flang-commits at lists.llvm.org
Fri Dec 1 10:42:42 PST 2023
================
@@ -819,6 +819,13 @@ genBoundsOps(fir::FirOpBuilder &builder, mlir::Location loc,
extent = fir::factory::readExtent(builder, loc, dataExv, dimension);
if (mlir::isa<fir::UndefOp>(extent.getDefiningOp())) {
extent = zero;
+ if (ubound && lbound &&
+ mlir::isa<mlir::arith::ConstantOp>(ubound.getDefiningOp()) &&
+ mlir::isa<mlir::arith::ConstantOp>(lbound.getDefiningOp())) {
----------------
clementval wrote:
Thanks for the fix. You can remove the check for constant. If lb and ub are set we can compute the extent even if those are variables. `a(n:m)` should also have a proper extent compute and not zero. The +1 is correct.
https://github.com/llvm/llvm-project/pull/73790
More information about the flang-commits
mailing list