Is there any notes or document about why arith dialect not support broadcast semantics

Hi, all.

I am try to learn Arith Dialect, and see it doesn’t support or implicit support broadcast. And Form the DialectConversion, it seems the Arith will been converted to LLVM/SPIPV dialect.
So I have a question about it, why Arith Dialect not support broadcast, or arithmetic compute between different shape data, as the hardware instructions in LLVM/SPIPV maybe support it. Does it means to lower operations to LLVM/SPIPV, we should firstly think about optimize about broadcast related operations in the high level?

Thanks for your reply.

Implicit broadcast semantics is typically used by ML or numeric frontends and is more of a user-level concern. It arguably makes it easier for the user to create code, but is difficult for the compiler to reason about. (In my personal opinion, it is also difficult for the user to reason about.) Practically, even when the frontend does support implicit broadcasting, early passes in the compiler make it explicit in the compiler’s internal representation. Neither LLVM nor SPIR-V support implicit broadcasting and are generally unaware of multi-dimensional operations.

Hi, ftynse, thanks for your reply, i have understand that. for LLVM/SPIR-V, the data load is divided with computational logi. The data align and load is user-level concerned.