Skip to content

Commit 9d81281

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#3472)
2 parents 615fd66 + 0a361de commit 9d81281

File tree

121 files changed

+2191
-1624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2191
-1624
lines changed

.ci/monolithic-linux.sh

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,25 @@ function at-exit {
3838
# If building fails there will be no results files.
3939
shopt -s nullglob
4040

41-
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":penguin: Linux x64 Test Results" \
42-
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
41+
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
42+
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":penguin: Linux x64 Test Results" \
43+
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
44+
fi
4345
}
4446
trap at-exit EXIT
4547

48+
function start-group {
49+
groupname=$1
50+
if [[ "$GITHUB_ACTIONS" != "" ]]; then
51+
echo "::endgroup"
52+
echo "::group::$groupname"
53+
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
54+
echo "@@@$STEP@@@"
55+
else
56+
echo "Starting $groupname"
57+
fi
58+
}
59+
4660
projects="${1}"
4761
targets="${2}"
4862
runtimes="${3}"
@@ -52,7 +66,7 @@ enable_cir="${6}"
5266

5367
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5468

55-
echo "::group::cmake"
69+
start-group "CMake"
5670
export PIP_BREAK_SYSTEM_PACKAGES=1
5771
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
5872

@@ -83,49 +97,39 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
8397
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
8498
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
8599

86-
echo "::endgroup::"
87-
echo "::group::ninja"
100+
start-group "ninja"
88101

89102
# Targets are not escaped as they are passed as separate arguments.
90103
ninja -C "${BUILD_DIR}" -k 0 ${targets}
91104

92-
echo "::endgroup::"
93-
94105
if [[ "${runtime_targets}" != "" ]]; then
95-
echo "::group::ninja runtimes"
106+
start-group "ninja Runtimes"
96107

97108
ninja -C "${BUILD_DIR}" ${runtime_targets}
98-
99-
echo "::endgroup::"
100109
fi
101110

102111
# Compiling runtimes with just-built Clang and running their tests
103112
# as an additional testing for Clang.
104113
if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
105-
echo "::group::cmake runtimes C++26"
114+
start-group "CMake Runtimes C++26"
106115

107116
cmake \
108117
-D LIBCXX_TEST_PARAMS="std=c++26" \
109118
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
110119
"${BUILD_DIR}"
111120

112-
echo "::endgroup::"
113-
echo "::group::ninja runtimes C++26"
121+
start-group "ninja Runtimes C++26"
114122

115123
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
116124

117-
echo "::endgroup::"
118-
echo "::group::cmake runtimes clang modules"
125+
start-group "CMake Runtimes Clang Modules"
119126

120127
cmake \
121128
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
122129
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
123130
"${BUILD_DIR}"
124131

125-
echo "::endgroup::"
126-
echo "::group::ninja runtimes clang modules"
132+
start-group "ninja Runtimes Clang Modules"
127133

128134
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
129-
130-
echo "::endgroup::"
131135
fi

.ci/monolithic-windows.sh

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,30 @@ function at-exit {
3232

3333
# If building fails there will be no results files.
3434
shopt -s nullglob
35-
36-
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":window: Windows x64 Test Results" \
37-
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
35+
36+
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
37+
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":window: Windows x64 Test Results" \
38+
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
39+
fi
3840
}
3941
trap at-exit EXIT
4042

43+
function start-group {
44+
groupname=$1
45+
if [[ "$GITHUB_ACTIONS" != "" ]]; then
46+
echo "::endgroup"
47+
echo "::group::$groupname"
48+
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
49+
echo "@@@$STEP@@@"
50+
else
51+
echo "Starting $groupname"
52+
fi
53+
}
54+
4155
projects="${1}"
4256
targets="${2}"
4357

44-
echo "::group::cmake"
58+
start-group "CMake"
4559
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
4660

4761
export CC=cl
@@ -71,10 +85,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7185
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
7286
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
7387

74-
echo "::endgroup::"
75-
echo "::group::ninja"
88+
start-group "ninja"
7689

7790
# Targets are not escaped as they are passed as separate arguments.
7891
ninja -C "${BUILD_DIR}" -k 0 ${targets}
79-
80-
echo "::endgroup"

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ jobs:
260260
- name: Install a current LLVM
261261
if: ${{ matrix.mingw != true }}
262262
run: |
263-
choco install -y llvm --version=19.1.7 --allow-downgrade
263+
choco install -y llvm --version=20.1.8 --allow-downgrade
264264
- name: Install llvm-mingw
265265
if: ${{ matrix.mingw == true }}
266266
run: |
267-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-x86_64.zip
267+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-x86_64.zip
268268
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
269269
del llvm-mingw*.zip
270270
mv llvm-mingw* c:\llvm-mingw

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5997,6 +5997,23 @@ bool Compiler<Emitter>::checkLiteralType(const Expr *E) {
59975997
return this->emitCheckLiteralType(E->getType().getTypePtr(), E);
59985998
}
59995999

6000+
static bool initNeedsOverridenLoc(const CXXCtorInitializer *Init) {
6001+
const Expr *InitExpr = Init->getInit();
6002+
6003+
if (!Init->isWritten() && !Init->isInClassMemberInitializer() &&
6004+
!isa<CXXConstructExpr>(InitExpr))
6005+
return true;
6006+
6007+
if (const auto *CE = dyn_cast<CXXConstructExpr>(InitExpr)) {
6008+
const CXXConstructorDecl *Ctor = CE->getConstructor();
6009+
if (Ctor->isDefaulted() && Ctor->isCopyOrMoveConstructor() &&
6010+
Ctor->isTrivial())
6011+
return true;
6012+
}
6013+
6014+
return false;
6015+
}
6016+
60006017
template <class Emitter>
60016018
bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
60026019
assert(!ReturnType);
@@ -6071,10 +6088,7 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
60716088
const Record::Field *F = R->getField(Member);
60726089

60736090
LocOverrideScope<Emitter> LOS(this, SourceInfo{},
6074-
!Init->isWritten() &&
6075-
!Init->isInClassMemberInitializer() &&
6076-
(!isa<CXXConstructExpr>(InitExpr) ||
6077-
Member->isAnonymousStructOrUnion()));
6091+
initNeedsOverridenLoc(Init));
60786092
if (!emitFieldInitializer(F, F->Offset, InitExpr, IsUnion))
60796093
return false;
60806094
} else if (const Type *Base = Init->getBaseClass()) {
@@ -6104,10 +6118,7 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
61046118
return false;
61056119
} else if (const IndirectFieldDecl *IFD = Init->getIndirectMember()) {
61066120
LocOverrideScope<Emitter> LOS(this, SourceInfo{},
6107-
!Init->isWritten() &&
6108-
!Init->isInClassMemberInitializer() &&
6109-
!isa<CXXConstructExpr>(InitExpr));
6110-
6121+
initNeedsOverridenLoc(Init));
61116122
assert(IFD->getChainingSize() >= 2);
61126123

61136124
unsigned NestedFieldOffset = 0;

clang/lib/AST/ByteCode/InterpFrame.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ static bool shouldSkipInBacktrace(const Function *F) {
133133
MD && MD->getParent()->isAnonymousStructOrUnion())
134134
return true;
135135

136+
if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(FD);
137+
Ctor && Ctor->isDefaulted() && Ctor->isTrivial() &&
138+
Ctor->isCopyOrMoveConstructor() && Ctor->inits().empty())
139+
return true;
140+
136141
return false;
137142
}
138143

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ inferOffloadToolchains(Compilation &C, Action::OffloadKind Kind) {
10161016
Arg *A = new Arg(Opt, C.getArgs().getArgString(Index), Index,
10171017
C.getArgs().MakeArgString(Triple.split("-").first),
10181018
C.getArgs().MakeArgString("--offload-arch=" + Arch));
1019+
A->claim();
10191020
C.getArgs().append(A);
10201021
C.getArgs().AddSynthesizedArg(A);
10211022
Triples.insert(Triple);

clang/lib/Headers/avxintrin.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3777,7 +3777,7 @@ _mm256_set_ps(float __a, float __b, float __c, float __d,
37773777
/// \param __i7
37783778
/// A 32-bit integral value used to initialize bits [31:0] of the result.
37793779
/// \returns An initialized 256-bit integer vector.
3780-
static __inline __m256i __DEFAULT_FN_ATTRS
3780+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
37813781
_mm256_set_epi32(int __i0, int __i1, int __i2, int __i3,
37823782
int __i4, int __i5, int __i6, int __i7)
37833783
{
@@ -3825,7 +3825,7 @@ _mm256_set_epi32(int __i0, int __i1, int __i2, int __i3,
38253825
/// \param __w00
38263826
/// A 16-bit integral value used to initialize bits [15:0] of the result.
38273827
/// \returns An initialized 256-bit integer vector.
3828-
static __inline __m256i __DEFAULT_FN_ATTRS
3828+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
38293829
_mm256_set_epi16(short __w15, short __w14, short __w13, short __w12,
38303830
short __w11, short __w10, short __w09, short __w08,
38313831
short __w07, short __w06, short __w05, short __w04,
@@ -3908,7 +3908,7 @@ _mm256_set_epi16(short __w15, short __w14, short __w13, short __w12,
39083908
/// \param __b00
39093909
/// An 8-bit integral value used to initialize bits [7:0] of the result.
39103910
/// \returns An initialized 256-bit integer vector.
3911-
static __inline __m256i __DEFAULT_FN_ATTRS
3911+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
39123912
_mm256_set_epi8(char __b31, char __b30, char __b29, char __b28,
39133913
char __b27, char __b26, char __b25, char __b24,
39143914
char __b23, char __b22, char __b21, char __b20,
@@ -3943,7 +3943,7 @@ _mm256_set_epi8(char __b31, char __b30, char __b29, char __b28,
39433943
/// \param __d
39443944
/// A 64-bit integral value used to initialize bits [63:0] of the result.
39453945
/// \returns An initialized 256-bit integer vector.
3946-
static __inline __m256i __DEFAULT_FN_ATTRS
3946+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
39473947
_mm256_set_epi64x(long long __a, long long __b, long long __c, long long __d)
39483948
{
39493949
return __extension__ (__m256i)(__v4di){ __d, __c, __b, __a };
@@ -4044,7 +4044,7 @@ _mm256_setr_ps(float __a, float __b, float __c, float __d,
40444044
/// \param __i7
40454045
/// A 32-bit integral value used to initialize bits [255:224] of the result.
40464046
/// \returns An initialized 256-bit integer vector.
4047-
static __inline __m256i __DEFAULT_FN_ATTRS
4047+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
40484048
_mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3,
40494049
int __i4, int __i5, int __i6, int __i7)
40504050
{
@@ -4092,7 +4092,7 @@ _mm256_setr_epi32(int __i0, int __i1, int __i2, int __i3,
40924092
/// \param __w00
40934093
/// A 16-bit integral value used to initialize bits [255:240] of the result.
40944094
/// \returns An initialized 256-bit integer vector.
4095-
static __inline __m256i __DEFAULT_FN_ATTRS
4095+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
40964096
_mm256_setr_epi16(short __w15, short __w14, short __w13, short __w12,
40974097
short __w11, short __w10, short __w09, short __w08,
40984098
short __w07, short __w06, short __w05, short __w04,
@@ -4177,7 +4177,7 @@ _mm256_setr_epi16(short __w15, short __w14, short __w13, short __w12,
41774177
/// \param __b00
41784178
/// An 8-bit integral value used to initialize bits [255:248] of the result.
41794179
/// \returns An initialized 256-bit integer vector.
4180-
static __inline __m256i __DEFAULT_FN_ATTRS
4180+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
41814181
_mm256_setr_epi8(char __b31, char __b30, char __b29, char __b28,
41824182
char __b27, char __b26, char __b25, char __b24,
41834183
char __b23, char __b22, char __b21, char __b20,
@@ -4210,7 +4210,7 @@ _mm256_setr_epi8(char __b31, char __b30, char __b29, char __b28,
42104210
/// \param __d
42114211
/// A 64-bit integral value used to initialize bits [255:192] of the result.
42124212
/// \returns An initialized 256-bit integer vector.
4213-
static __inline __m256i __DEFAULT_FN_ATTRS
4213+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
42144214
_mm256_setr_epi64x(long long __a, long long __b, long long __c, long long __d)
42154215
{
42164216
return _mm256_set_epi64x(__d, __c, __b, __a);
@@ -4267,7 +4267,7 @@ _mm256_set1_ps(float __w)
42674267
/// A 32-bit integral value used to initialize each vector element of the
42684268
/// result.
42694269
/// \returns An initialized 256-bit integer vector of [8 x i32].
4270-
static __inline __m256i __DEFAULT_FN_ATTRS
4270+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
42714271
_mm256_set1_epi32(int __i)
42724272
{
42734273
return _mm256_set_epi32(__i, __i, __i, __i, __i, __i, __i, __i);
@@ -4285,7 +4285,7 @@ _mm256_set1_epi32(int __i)
42854285
/// A 16-bit integral value used to initialize each vector element of the
42864286
/// result.
42874287
/// \returns An initialized 256-bit integer vector of [16 x i16].
4288-
static __inline __m256i __DEFAULT_FN_ATTRS
4288+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
42894289
_mm256_set1_epi16(short __w)
42904290
{
42914291
return _mm256_set_epi16(__w, __w, __w, __w, __w, __w, __w, __w,
@@ -4303,7 +4303,7 @@ _mm256_set1_epi16(short __w)
43034303
/// An 8-bit integral value used to initialize each vector element of the
43044304
/// result.
43054305
/// \returns An initialized 256-bit integer vector of [32 x i8].
4306-
static __inline __m256i __DEFAULT_FN_ATTRS
4306+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
43074307
_mm256_set1_epi8(char __b)
43084308
{
43094309
return _mm256_set_epi8(__b, __b, __b, __b, __b, __b, __b, __b,
@@ -4324,7 +4324,7 @@ _mm256_set1_epi8(char __b)
43244324
/// A 64-bit integral value used to initialize each vector element of the
43254325
/// result.
43264326
/// \returns An initialized 256-bit integer vector of [4 x i64].
4327-
static __inline __m256i __DEFAULT_FN_ATTRS
4327+
static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
43284328
_mm256_set1_epi64x(long long __q)
43294329
{
43304330
return _mm256_set_epi64x(__q, __q, __q, __q);

clang/test/AST/ByteCode/cxx11.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,15 @@ namespace PR19010 {
318318
};
319319
void test() { constexpr Test t; }
320320
}
321+
322+
namespace ReadMutableInCopyCtor {
323+
struct G {
324+
struct X {};
325+
union U { X a; };
326+
mutable U u; // both-note {{declared here}}
327+
};
328+
constexpr G g1 = {};
329+
constexpr G g2 = g1; // both-error {{must be initialized by a constant expression}} \
330+
// both-note {{read of mutable member 'u'}} \
331+
// both-note {{in call to 'G(g1)'}}
332+
}

0 commit comments

Comments
 (0)