Skip to content

Commit 980bf0a

Browse files
committed
Fix explicit storage folding check for inductive functions
1 parent cd300fe commit 980bf0a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/StorageFolding.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ class InjectFoldingCheck : public IRMutator {
172172
body = mutate(op->body);
173173
} else {
174174
// Update valid range based on bounds written to.
175-
Box b = box_provided(body, func.name());
175+
Box provided = box_provided(body, func.name());
176+
Box required = box_required(body, func.name());
177+
required.used = Expr();
178+
Box b = box_union(provided, required);
176179
Expr old_leading_edge =
177180
Load::make(Int(32), head + "_next", 0, Buffer<>(), Parameter(), const_true(), ModulusRemainder());
178181

0 commit comments

Comments
 (0)