git: 0bb380693227 - stable/13 - Merge commit 989879f8fded from llvm git (by Paul Walker):

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 24 Dec 2023 14:02:39 UTC
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=0bb380693227a5f87235bfe07c16ce1eb8b65a84

commit 0bb380693227a5f87235bfe07c16ce1eb8b65a84
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-12-04 17:59:02 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-12-24 13:59:50 +0000

    Merge commit 989879f8fded from llvm git (by Paul Walker):
    
      [Clang] Allow C++11 style initialisation of SVE types.
    
      Fixes https://github.com/llvm/llvm-project/issues/63223
    
      Differential Revision: https://reviews.llvm.org/D153560
    
    Requested by:   andrew
    MFC after:      3 days
    
    (cherry picked from commit 641efdd10cc3ad05fb7eaeeae20b15c5ad4128c8)
---
 contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp
index a0dcb978b1ac..ba8b5ab502d2 100644
--- a/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1861,6 +1861,23 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) {
     return Visit(E->getInit(0));
   }
 
+  if (isa<llvm::ScalableVectorType>(VType)) {
+    if (NumInitElements == 0) {
+      // C++11 value-initialization for the vector.
+      return EmitNullValue(E->getType());
+    }
+
+    if (NumInitElements == 1) {
+      Expr *InitVector = E->getInit(0);
+
+      // Initialize from another scalable vector of the same type.
+      if (InitVector->getType() == E->getType())
+        return Visit(InitVector);
+    }
+
+    llvm_unreachable("Unexpected initialization of a scalable vector!");
+  }
+
   unsigned ResElts = cast<llvm::FixedVectorType>(VType)->getNumElements();
 
   // Loop over initializers collecting the Value for each, and remembering