git: 641efdd10cc3 - main - Merge commit 989879f8fded from llvm git (by Paul Walker):
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 04 Dec 2023 17:59:32 UTC
The branch main has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=641efdd10cc3ad05fb7eaeeae20b15c5ad4128c8
commit 641efdd10cc3ad05fb7eaeeae20b15c5ad4128c8
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-12-04 17:59:02 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-12-04 17:59:11 +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
---
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