[llvm] [X86] Add ISD::MULHS/MULHU v4i64/v8i64 lowering (PR #169819)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 28 08:22:39 PDT 2026


Andarwinux wrote:

> Thanks @Andarwinux. Yes,
> 
> * For `div_vec` (`MULHS`), AVX-512 supports `vpsraq` so no regression.
> * For `wyhash`, `-mprefer-vector-width=512` enables AVX-512 `zmm`, so ~2× the vector throughput. The runtime diff is negligible.
> 
> Personally I would like to maximize the performance at AVX-512 but am still hesitate to do so cuz the AVX2 platform is still popular.

I think it's reasonable to enable MULHS lowering only for AVX-512, which would keep scalarisation on AVX2.

Not sure if there's still space to improve vectorized MULHS on AVX2, but at least doing so would still be much better than the current state: even MULHU can't keep vectorization.

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


More information about the llvm-commits mailing list