halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.89k stars 1.07k forks source link

Add support to CodeGen_LLVM for generating architecture specific assertions. #8092

Open zvookin opened 8 months ago

zvookin commented 8 months ago

CodeGen_ARM, for SVE, generates a runtime check that the current processor supports the vector length compiled for. This is done in begin_func by checking if the current function does not have internal linkage. Adding a specific method to accomplisht his would be cleaner.

zvookin commented 8 months ago

See b0e4f995b8ab5ece0edab896703048f2c9b32410 .

abadams commented 8 months ago

I suspect the thing to do is override compile(Module) in CodeGen_ARM to run an inject-assertions IRMutator on the right LoweredFunc, and then call the base class method. Or maybe override compile(LoweredFunc) and just mutate the ones with an external linkage type