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

Jasmine Tang via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 08:31:08 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");
+    assert(Ty->isIntegerTy());
+    SmallVector<APInt, 8> MulVector;
----------------
badumbatish wrote:

very nice advice, ty Luke, will fix

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


More information about the llvm-commits mailing list