Closed mcourteaux closed 1 week ago
This is actually a bit more subtle, because it's loop_var < min + extent, not loop_var < extent, but a scoped truth comparison on non-constants will really just look for that exact Expr. Maybe loop_var < mutate(min + extent, nullptr)
?
Aren't loops rebased to have a zero starting range at that point?
The simplifier can run on almost any piece of IR, before or after loops get rebased to zero, so if you wanted to go with that strategy you'd have to add an if (is_const_zero(op->min))
EDIT: But if is is zero, then the thing I suggested above will collapse to just the extent anyway.
@abadams Okay, I think I fixed it. Thanks for helping out!
Fixes #8303