Skip to content

Commit 004d26b

Browse files
committed
Fix h6e and m0.
1 parent 20f5011 commit 004d26b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

flang/lib/Lower/ConvertExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5607,7 +5607,7 @@ class ArrayExprLowering {
56075607
arrModify.getResult(1));
56085608
};
56095609
}
5610-
return [=](IterSpace iters) mutable {
5610+
return [=, semant = this->semant](IterSpace iters) mutable {
56115611
auto [path, eleTy, substringBounds] =
56125612
lowerPath(loc, revPath, load, iters);
56135613
if (semant == ConstituentSemantics::RefOpaque ||

flang/lib/Lower/IterationSpace.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,6 @@ class StackableConstructExpr {
150150
stack.push_back(A{});
151151
}
152152

153-
void shrinkStack() {
154-
assert(!empty());
155-
stack.pop_back();
156-
if (empty())
157-
stmtCtx.finalize();
158-
}
159-
160153
/// Bind a front-end expression to a closure.
161154
void bind(FrontEndExpr e, GenerateElementalArrayFunc &&fun) {
162155
vmap.insert({e, std::move(fun)});
@@ -182,6 +175,15 @@ class StackableConstructExpr {
182175
StatementContext &stmtContext() { return stmtCtx; }
183176

184177
protected:
178+
void shrinkStack() {
179+
assert(!empty());
180+
stack.pop_back();
181+
if (empty()) {
182+
stmtCtx.finalize();
183+
vmap.clear();
184+
}
185+
}
186+
185187
// The stack for the construct information.
186188
llvm::SmallVector<A> stack;
187189

@@ -211,6 +213,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &, const ImplicitIterSpace &);
211213
class ImplicitIterSpace
212214
: public StackableConstructExpr<llvm::SmallVector<FrontEndExpr>> {
213215
public:
216+
using Base = StackableConstructExpr<llvm::SmallVector<FrontEndExpr>>;
214217
using FrontEndMaskExpr = FrontEndExpr;
215218

216219
friend llvm::raw_ostream &operator<<(llvm::raw_ostream &,
@@ -262,6 +265,12 @@ class ImplicitIterSpace
262265
return stack;
263266
}
264267

268+
void shrinkStack() {
269+
Base::shrinkStack();
270+
if (stack.empty())
271+
maskVarMap.clear();
272+
}
273+
265274
private:
266275
llvm::DenseMap<FrontEndExpr,
267276
std::tuple<mlir::Value, mlir::Value, mlir::Value>>

0 commit comments

Comments
 (0)