[llvm] [WebAssembly] Fold extended vector shifts by constant to extmul (PR #184007)

Sam Parker via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 02:11:42 PST 2026


================
@@ -195,3 +195,47 @@ define <8 x i32> @zext_sext_mul_v8i16(<8 x i16> %a, <8 x i16> %b) {
   %mul = mul <8 x i32> %wide.a, %wide.b
   ret <8 x i32> %mul
 }
+
+define <4 x i32> @sext_mul_v8i16_with_symmetric_constant_vector(<8 x i16> %v) {
----------------
sparker-arm wrote:

Ah, okay. So this is happening _after_ type legalization, now it makes sense.

Instead of calling this from `LowerShift`, you can run it as a target-specific DAG-combine, which will allow you to optimise before type legalization. This should allow you to create one constant vector. 

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


More information about the llvm-commits mailing list