[clang] [CIR] Upstream splat op for VectorType (PR #139827)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu May 15 10:31:38 PDT 2025


================
@@ -1650,6 +1650,14 @@ mlir::Value ScalarExprEmitter::VisitCastExpr(CastExpr *ce) {
                               cgf.convertType(destTy));
   }
 
+  case CK_VectorSplat: {
+    // Create a vector object and fill all elements with the same scalar value.
+    assert(destTy->isVectorType() && "CK_VectorSplat to non-vector type");
+    return cgf.getBuilder().create<cir::VecSplatOp>(
----------------
andykaylor wrote:

```suggestion
    return builder.create<cir::VecSplatOp>(
```

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


More information about the cfe-commits mailing list