Halide icon indicating copy to clipboard operation
Halide copied to clipboard

Might want to keep track of constant bounds during codegen

Open rootjalex opened this issue 1 year ago • 3 comments

#7805 adds support for using constant bounds inference to perform instruction selection on x86, HVX, and WASM. It works for small tests, but might be more powerful if we track a scope of constant bounds while traversing the Expr AST for codegen. This is just a tracking issue for that TODO.

rootjalex avatar Apr 29 '24 18:04 rootjalex

Yeah, it'd be updated in the Let/LetStmt visitor in the base class I think.

abadams avatar Apr 29 '24 18:04 abadams

Yeah, the main reason I don't just add it to #7805 is that I suspect it would be best to only track "useful" expression bounds (especially because bounds are currently useless for anything other than saturating narrow instructions), and it feels a waste to keep a scope around + compute constant bounds for every single expression during codegen.

rootjalex avatar Apr 29 '24 18:04 rootjalex

Will be fixed in #8155 , which makes cheap constant bounds available in codegen and uses it for a handful of things. Still no tracking through let / letstmts though (it should probably be done lazily)

abadams avatar Jun 04 '24 18:06 abadams