[llvm] [WebAssembly] Constant fold wasm.dot (PR #149619)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 28 09:13:29 PDT 2025


================
@@ -3826,6 +3827,37 @@ static Constant *ConstantFoldFixedVectorCall(
     }
     return ConstantVector::get(Result);
   }
+  case Intrinsic::wasm_dot: {
+    unsigned NumElements =
+        cast<FixedVectorType>(Operands[0]->getType())->getNumElements();
+
+    assert(NumElements == 8 && Result.size() == 4 &&
+           "wasm dot takes i16x8 and produces i32x4");
----------------
lukel97 wrote:

Nit
 ```suggestion
    assert(NumElements == 8 && Result.size() == 4 &&
           "wasm_dot takes i16x8 and produces i32x4");
```

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


More information about the llvm-commits mailing list