Skip to content

Commit

Permalink
scoped_truth for the loop variable being always less than the loop ex…
Browse files Browse the repository at this point in the history
…tent.
  • Loading branch information
mcourteaux committed Jun 20, 2024
1 parent f9ccd5c commit c0c4f73
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Simplify_Stmts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ Stmt Simplify::visit(const For *op) {
loop_var_info);

// If we're in the loop, the extent must be greater than 0.
ScopedFact fact = scoped_truth(extent_positive);
ScopedFact fact_extent_positive = scoped_truth(extent_positive);

// The loop variable will never exceed the loop bound.
Expr loop_var = Variable::make(Int(32), op->name);
ScopedFact fact_loop_var_less_than_extent = scoped_truth(loop_var < new_extent);

new_body = mutate(op->body);
}

Expand Down

0 comments on commit c0c4f73

Please sign in to comment.