[Mlir-commits] [mlir] [mlir] [vector] try promoting scalar when reordering broadcast/elementwise (PR #212180)

Chuanqi Xu llvmlistbot at llvm.org
Thu Aug 20 02:10:43 PDT 2026


ChuanqiXu9 wrote:

> I don't get this. `%arg1` is a scalar, so arguably we should just not broadcast at all, do a scalar `math.mfma` and broadcast the result. If we wanted to stay entirely within vector, we "broadcast" a scalar to `vector<1x>`, mfma that, and then broadcast to the desired shape. Otherwise we are doing more work than necessary.

Hi, thanks for looking into this. I am not sure I misunderstand. I don't think we can avoid broadcasting at all. As `%arg0` and `%arg1` are vector<4xf32> and `%arg1` are `f32`. So I think we have to introduce broadcast to make the shape consistent.

https://github.com/llvm/llvm-project/pull/212180


More information about the Mlir-commits mailing list