Skip to content

Commit b72476c

Browse files
committed
Merge branch 'fix-mlir-jit-with-global_ctors' of https://github.com/jackalcooper/llvm-project into fix-mlir-jit-with-global_ctors
2 parents ca35dde + 6122c0b commit b72476c

File tree

122 files changed

+3240
-1716
lines changed

Some content is hidden

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

122 files changed

+3240
-1716
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ concurrency:
3636
jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
39-
runs-on: llvm-premerge-libcxx-runners
39+
runs-on: llvm-premerge-libcxx-next-runners
4040
continue-on-error: false
4141
strategy:
4242
fail-fast: false
@@ -47,8 +47,8 @@ jobs:
4747
'generic-cxx26',
4848
'generic-modules'
4949
]
50-
cc: [ 'clang-21' ]
51-
cxx: [ 'clang++-21' ]
50+
cc: [ 'clang-22' ]
51+
cxx: [ 'clang++-22' ]
5252
include:
5353
- config: 'generic-gcc'
5454
cc: 'gcc-15'
@@ -73,7 +73,7 @@ jobs:
7373
**/crash_diagnostics/*
7474
stage2:
7575
if: github.repository_owner == 'llvm'
76-
runs-on: llvm-premerge-libcxx-runners
76+
runs-on: llvm-premerge-libcxx-next-runners
7777
needs: [ stage1 ]
7878
continue-on-error: false
7979
strategy:
@@ -86,18 +86,18 @@ jobs:
8686
'generic-cxx20',
8787
'generic-cxx23'
8888
]
89-
cc: [ 'clang-21' ]
90-
cxx: [ 'clang++-21' ]
89+
cc: [ 'clang-22' ]
90+
cxx: [ 'clang++-22' ]
9191
include:
9292
- config: 'generic-gcc-cxx11'
9393
cc: 'gcc-15'
9494
cxx: 'g++-15'
95+
- config: 'generic-cxx26'
96+
cc: 'clang-21'
97+
cxx: 'clang++-21'
9598
- config: 'generic-cxx26'
9699
cc: 'clang-20'
97100
cxx: 'clang++-20'
98-
- config: 'generic-cxx26'
99-
cc: 'clang-19'
100-
cxx: 'clang++-19'
101101
steps:
102102
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103103
- name: ${{ matrix.config }}
@@ -148,27 +148,27 @@ jobs:
148148
'generic-static',
149149
'bootstrapping-build'
150150
]
151-
machine: [ 'llvm-premerge-libcxx-runners' ]
151+
machine: [ 'llvm-premerge-libcxx-next-runners' ]
152152
include:
153153
- config: 'generic-cxx26'
154-
machine: llvm-premerge-libcxx-runners
154+
machine: llvm-premerge-libcxx-next-runners
155155
- config: 'generic-asan'
156-
machine: llvm-premerge-libcxx-runners
156+
machine: llvm-premerge-libcxx-next-runners
157157
- config: 'generic-tsan'
158-
machine: llvm-premerge-libcxx-runners
158+
machine: llvm-premerge-libcxx-next-runners
159159
- config: 'generic-ubsan'
160-
machine: llvm-premerge-libcxx-runners
160+
machine: llvm-premerge-libcxx-next-runners
161161
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
162162
- config: 'generic-msan'
163-
machine: llvm-premerge-libcxx-runners
163+
machine: llvm-premerge-libcxx-next-runners
164164
runs-on: ${{ matrix.machine }}
165165
steps:
166166
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
167167
- name: ${{ matrix.config }}
168168
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
169169
env:
170-
CC: clang-21
171-
CXX: clang++-21
170+
CC: clang-22
171+
CXX: clang++-22
172172
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
173173
if: always()
174174
with:

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -945,10 +945,6 @@ let Features = "xop", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in
945945
def vphsubwd : X86Builtin<"_Vector<4, int>(_Vector<8, short>)">;
946946
def vphsubdq : X86Builtin<"_Vector<2, long long int>(_Vector<4, int>)">;
947947
def vpperm : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>, _Vector<16, char>)">;
948-
def vprotb : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>)">;
949-
def vprotw : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>)">;
950-
def vprotd : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>)">;
951-
def vprotq : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Vector<2, long long int>)">;
952948
def vprotbi : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Constant char)">;
953949
def vprotwi : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Constant char)">;
954950
def vprotdi : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Constant char)">;
@@ -1882,78 +1878,6 @@ let Features = "avx512vbmi2,evex512", Attributes = [NoThrow, Const, RequiredVect
18821878
def vpshldw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<32, short>, _Constant int)">;
18831879
}
18841880

1885-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
1886-
def vpshldvd128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>, _Vector<4, int>)">;
1887-
}
1888-
1889-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
1890-
def vpshldvd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>, _Vector<8, int>)">;
1891-
}
1892-
1893-
let Features = "avx512vbmi2,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
1894-
def vpshldvd512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Vector<16, int>, _Vector<16, int>)">;
1895-
}
1896-
1897-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
1898-
def vpshldvq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Vector<2, long long int>, _Vector<2, long long int>)">;
1899-
}
1900-
1901-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
1902-
def vpshldvq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<4, long long int>, _Vector<4, long long int>)">;
1903-
}
1904-
1905-
let Features = "avx512vbmi2,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
1906-
def vpshldvq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Vector<8, long long int>, _Vector<8, long long int>)">;
1907-
}
1908-
1909-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
1910-
def vpshldvw128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>, _Vector<8, short>)">;
1911-
}
1912-
1913-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
1914-
def vpshldvw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>, _Vector<16, short>)">;
1915-
}
1916-
1917-
let Features = "avx512vbmi2,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
1918-
def vpshldvw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<32, short>, _Vector<32, short>)">;
1919-
}
1920-
1921-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
1922-
def vpshrdvd128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>, _Vector<4, int>)">;
1923-
}
1924-
1925-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
1926-
def vpshrdvd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>, _Vector<8, int>)">;
1927-
}
1928-
1929-
let Features = "avx512vbmi2,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
1930-
def vpshrdvd512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Vector<16, int>, _Vector<16, int>)">;
1931-
}
1932-
1933-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
1934-
def vpshrdvq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Vector<2, long long int>, _Vector<2, long long int>)">;
1935-
}
1936-
1937-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
1938-
def vpshrdvq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<4, long long int>, _Vector<4, long long int>)">;
1939-
}
1940-
1941-
let Features = "avx512vbmi2,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
1942-
def vpshrdvq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Vector<8, long long int>, _Vector<8, long long int>)">;
1943-
}
1944-
1945-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
1946-
def vpshrdvw128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>, _Vector<8, short>)">;
1947-
}
1948-
1949-
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
1950-
def vpshrdvw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>, _Vector<16, short>)">;
1951-
}
1952-
1953-
let Features = "avx512vbmi2,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
1954-
def vpshrdvw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<32, short>, _Vector<32, short>)">;
1955-
}
1956-
19571881
let Features = "avx512vl,avx512vbmi2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
19581882
def vpshrdd128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>, _Constant int)">;
19591883
}
@@ -2165,28 +2089,10 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256
21652089
}
21662090

21672091
let Features = "avx512f,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
2168-
def prolvd512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Vector<16, int>)">;
2169-
def prolvq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Vector<8, long long int>)">;
21702092
def prord512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Constant int)">;
21712093
def prorq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Constant int)">;
21722094
}
21732095

2174-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2175-
def prolvd128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>)">;
2176-
}
2177-
2178-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2179-
def prolvd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>)">;
2180-
}
2181-
2182-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2183-
def prolvq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Vector<2, long long int>)">;
2184-
}
2185-
2186-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2187-
def prolvq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<4, long long int>)">;
2188-
}
2189-
21902096
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
21912097
def prord128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Constant int)">;
21922098
}
@@ -2203,27 +2109,6 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256
22032109
def prorq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Constant int)">;
22042110
}
22052111

2206-
let Features = "avx512f,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
2207-
def prorvd512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Vector<16, int>)">;
2208-
def prorvq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Vector<8, long long int>)">;
2209-
}
2210-
2211-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2212-
def prorvd128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>)">;
2213-
}
2214-
2215-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2216-
def prorvd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>)">;
2217-
}
2218-
2219-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2220-
def prorvq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Vector<2, long long int>)">;
2221-
}
2222-
2223-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2224-
def prorvq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<4, long long int>)">;
2225-
}
2226-
22272112
let Features = "avx512bw,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
22282113
def pshufhw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Constant int)">;
22292114
def pshuflw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Constant int)">;

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,11 +1783,24 @@ static bool interp__builtin_memcpy(InterpState &S, CodePtr OpPC,
17831783
if (DestPtr.isDummy() || SrcPtr.isDummy())
17841784
return false;
17851785

1786+
if (DestPtr.getType()->isIncompleteType()) {
1787+
S.FFDiag(S.Current->getSource(OpPC),
1788+
diag::note_constexpr_memcpy_incomplete_type)
1789+
<< Move << DestPtr.getType();
1790+
return false;
1791+
}
1792+
if (SrcPtr.getType()->isIncompleteType()) {
1793+
S.FFDiag(S.Current->getSource(OpPC),
1794+
diag::note_constexpr_memcpy_incomplete_type)
1795+
<< Move << SrcPtr.getType();
1796+
return false;
1797+
}
1798+
17861799
QualType DestElemType = getElemType(DestPtr);
17871800
if (DestElemType->isIncompleteType()) {
17881801
S.FFDiag(S.Current->getSource(OpPC),
1789-
diag::note_constexpr_ltor_incomplete_type)
1790-
<< DestElemType;
1802+
diag::note_constexpr_memcpy_incomplete_type)
1803+
<< Move << DestElemType;
17911804
return false;
17921805
}
17931806

@@ -1832,16 +1845,6 @@ static bool interp__builtin_memcpy(InterpState &S, CodePtr OpPC,
18321845
return false;
18331846
}
18341847

1835-
if (DestElemType->isIncompleteType() ||
1836-
DestPtr.getType()->isIncompleteType()) {
1837-
QualType DiagType =
1838-
DestElemType->isIncompleteType() ? DestElemType : DestPtr.getType();
1839-
S.FFDiag(S.Current->getSource(OpPC),
1840-
diag::note_constexpr_memcpy_incomplete_type)
1841-
<< Move << DiagType;
1842-
return false;
1843-
}
1844-
18451848
if (!DestElemType.isTriviallyCopyableType(ASTCtx)) {
18461849
S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_memcpy_nontrivial)
18471850
<< Move << DestElemType;
@@ -2030,8 +2033,13 @@ static bool interp__builtin_memchr(InterpState &S, CodePtr OpPC,
20302033
return true;
20312034
}
20322035

2033-
if (Ptr.isDummy())
2036+
if (Ptr.isDummy()) {
2037+
if (Ptr.getType()->isIncompleteType())
2038+
S.FFDiag(S.Current->getSource(OpPC),
2039+
diag::note_constexpr_ltor_incomplete_type)
2040+
<< Ptr.getType();
20342041
return false;
2042+
}
20352043

20362044
// Null is only okay if the given size is 0.
20372045
if (Ptr.isZero()) {

clang/lib/CodeGen/TargetBuiltins/X86.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,10 +1932,6 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
19321932
return SI;
19331933
}
19341934
// Rotate is a special case of funnel shift - 1st 2 args are the same.
1935-
case X86::BI__builtin_ia32_vprotb:
1936-
case X86::BI__builtin_ia32_vprotw:
1937-
case X86::BI__builtin_ia32_vprotd:
1938-
case X86::BI__builtin_ia32_vprotq:
19391935
case X86::BI__builtin_ia32_vprotbi:
19401936
case X86::BI__builtin_ia32_vprotwi:
19411937
case X86::BI__builtin_ia32_vprotdi:
@@ -1946,25 +1942,13 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
19461942
case X86::BI__builtin_ia32_prolq128:
19471943
case X86::BI__builtin_ia32_prolq256:
19481944
case X86::BI__builtin_ia32_prolq512:
1949-
case X86::BI__builtin_ia32_prolvd128:
1950-
case X86::BI__builtin_ia32_prolvd256:
1951-
case X86::BI__builtin_ia32_prolvd512:
1952-
case X86::BI__builtin_ia32_prolvq128:
1953-
case X86::BI__builtin_ia32_prolvq256:
1954-
case X86::BI__builtin_ia32_prolvq512:
19551945
return EmitX86FunnelShift(*this, Ops[0], Ops[0], Ops[1], false);
19561946
case X86::BI__builtin_ia32_prord128:
19571947
case X86::BI__builtin_ia32_prord256:
19581948
case X86::BI__builtin_ia32_prord512:
19591949
case X86::BI__builtin_ia32_prorq128:
19601950
case X86::BI__builtin_ia32_prorq256:
19611951
case X86::BI__builtin_ia32_prorq512:
1962-
case X86::BI__builtin_ia32_prorvd128:
1963-
case X86::BI__builtin_ia32_prorvd256:
1964-
case X86::BI__builtin_ia32_prorvd512:
1965-
case X86::BI__builtin_ia32_prorvq128:
1966-
case X86::BI__builtin_ia32_prorvq256:
1967-
case X86::BI__builtin_ia32_prorvq512:
19681952
return EmitX86FunnelShift(*this, Ops[0], Ops[0], Ops[1], true);
19691953
case X86::BI__builtin_ia32_selectb_128:
19701954
case X86::BI__builtin_ia32_selectb_256:
@@ -2357,29 +2341,6 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
23572341
// Ops 0 and 1 are swapped.
23582342
return EmitX86FunnelShift(*this, Ops[1], Ops[0], Ops[2], true);
23592343

2360-
case X86::BI__builtin_ia32_vpshldvd128:
2361-
case X86::BI__builtin_ia32_vpshldvd256:
2362-
case X86::BI__builtin_ia32_vpshldvd512:
2363-
case X86::BI__builtin_ia32_vpshldvq128:
2364-
case X86::BI__builtin_ia32_vpshldvq256:
2365-
case X86::BI__builtin_ia32_vpshldvq512:
2366-
case X86::BI__builtin_ia32_vpshldvw128:
2367-
case X86::BI__builtin_ia32_vpshldvw256:
2368-
case X86::BI__builtin_ia32_vpshldvw512:
2369-
return EmitX86FunnelShift(*this, Ops[0], Ops[1], Ops[2], false);
2370-
2371-
case X86::BI__builtin_ia32_vpshrdvd128:
2372-
case X86::BI__builtin_ia32_vpshrdvd256:
2373-
case X86::BI__builtin_ia32_vpshrdvd512:
2374-
case X86::BI__builtin_ia32_vpshrdvq128:
2375-
case X86::BI__builtin_ia32_vpshrdvq256:
2376-
case X86::BI__builtin_ia32_vpshrdvq512:
2377-
case X86::BI__builtin_ia32_vpshrdvw128:
2378-
case X86::BI__builtin_ia32_vpshrdvw256:
2379-
case X86::BI__builtin_ia32_vpshrdvw512:
2380-
// Ops 0 and 1 are swapped.
2381-
return EmitX86FunnelShift(*this, Ops[1], Ops[0], Ops[2], true);
2382-
23832344
// Reductions
23842345
case X86::BI__builtin_ia32_reduce_fadd_pd512:
23852346
case X86::BI__builtin_ia32_reduce_fadd_ps512:

0 commit comments

Comments
 (0)