Skip to content

Commit 58ecb6f

Browse files
committed
merge main into amd-stg-open
Change-Id: I2f3f94b5fc91cc728d23e96e437a6d887c782d34
2 parents 4ab4d4c + 9ba74c2 commit 58ecb6f

File tree

95 files changed

+2352
-1433
lines changed

Some content is hidden

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

95 files changed

+2352
-1433
lines changed

.ci/monolithic-linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4949
-D LLVM_ENABLE_LLD=ON \
5050
-D CMAKE_CXX_FLAGS=-gmlt \
5151
-D BOLT_CLANG_EXE=/usr/bin/clang \
52-
-D LLVM_CCACHE_BUILD=ON
52+
-D LLVM_CCACHE_BUILD=ON \
53+
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
5354

5455
echo "--- ninja"
5556
# Targets are not escaped as they are passed as separate arguments.

.ci/monolithic-windows.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4848
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml" \
4949
-D COMPILER_RT_BUILD_ORC=OFF \
5050
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
51-
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache
51+
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
52+
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
5253

5354
echo "--- ninja"
5455
# Targets are not escaped as they are passed as separate arguments.

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4143,10 +4143,6 @@ void BinaryFunction::updateOutputValues(const BOLTLinker &Linker) {
41434143
if (!requiresAddressMap())
41444144
return;
41454145

4146-
// Output ranges should match the input if the body hasn't changed.
4147-
if (!isSimple() && !BC.HasRelocations)
4148-
return;
4149-
41504146
// AArch64 may have functions that only contains a constant island (no code).
41514147
if (getLayout().block_empty())
41524148
return;
@@ -4194,6 +4190,12 @@ void BinaryFunction::updateOutputValues(const BOLTLinker &Linker) {
41944190
? FF.getAddress() + FF.getImageSize()
41954191
: getOutputAddress() + getOutputSize());
41964192
}
4193+
4194+
// Reset output addresses for deleted blocks.
4195+
for (BinaryBasicBlock *BB : DeletedBasicBlocks) {
4196+
BB->setOutputStartAddress(0);
4197+
BB->setOutputEndAddress(0);
4198+
}
41974199
}
41984200

41994201
DebugAddressRangesVector BinaryFunction::getOutputAddressRanges() const {

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,11 @@ Bug Fixes to C++ Support
799799
declaration definition. Fixes:
800800
(`#61763 <https://github.com/llvm/llvm-project/issues/61763>`_)
801801

802+
- Fix a bug where implicit deduction guides are not correctly generated for nested template
803+
classes. Fixes:
804+
(`#46200 <https://github.com/llvm/llvm-project/issues/46200>`_)
805+
(`#57812 <https://github.com/llvm/llvm-project/issues/57812>`_)
806+
802807
- Diagnose use of a variable-length array in a coroutine. The design of
803808
coroutines is such that it is not possible to support VLA use. Fixes:
804809
(`#65858 <https://github.com/llvm/llvm-project/issues/65858>`_)

clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,12 +2032,7 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenModule &CGM,
20322032
{llvm::Constant::getNullValue(CGM.Int64Ty), WarpID});
20332033
// Casting to actual data type.
20342034
// MediumPtr = (CopyType*)MediumPtrAddr;
2035-
Address MediumPtr(
2036-
Bld.CreateBitCast(
2037-
MediumPtrVal,
2038-
CopyType->getPointerTo(
2039-
MediumPtrVal->getType()->getPointerAddressSpace())),
2040-
CopyType, Align);
2035+
Address MediumPtr(MediumPtrVal, CopyType, Align);
20412036

20422037
// elem = *elemptr
20432038
//*MediumPtr = elem
@@ -2084,12 +2079,7 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenModule &CGM,
20842079
TransferMedium->getValueType(), TransferMedium,
20852080
{llvm::Constant::getNullValue(CGM.Int64Ty), ThreadID});
20862081
// SrcMediumVal = *SrcMediumPtr;
2087-
Address SrcMediumPtr(
2088-
Bld.CreateBitCast(
2089-
SrcMediumPtrVal,
2090-
CopyType->getPointerTo(
2091-
SrcMediumPtrVal->getType()->getPointerAddressSpace())),
2092-
CopyType, Align);
2082+
Address SrcMediumPtr(SrcMediumPtrVal, CopyType, Align);
20932083

20942084
// TargetElemPtr = (CopyType*)(SrcDataAddr[i]) + I
20952085
Address TargetElemPtrPtr = Bld.CreateConstArrayGEP(LocalReduceList, Idx);

clang/lib/Headers/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ set(ppc_htm_files
116116
)
117117

118118
set(riscv_files
119+
riscv_bitmanip.h
120+
riscv_crypto.h
119121
riscv_ntlh.h
120122
sifive_vector.h
121123
)

clang/lib/Headers/riscv_bitmanip.h

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
/*===---- riscv_bitmanip.h - RISC-V Zb* intrinsics --------------------------===
2+
*
3+
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
* See https://llvm.org/LICENSE.txt for license information.
5+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
*
7+
*===-----------------------------------------------------------------------===
8+
*/
9+
10+
#ifndef __RISCV_BITMANIP_H
11+
#define __RISCV_BITMANIP_H
12+
13+
#include <stdint.h>
14+
15+
#if defined(__cplusplus)
16+
extern "C" {
17+
#endif
18+
19+
#if defined(__riscv_zbb)
20+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
21+
__riscv_orc_b_32(uint32_t __x) {
22+
return __builtin_riscv_orc_b_32(__x);
23+
}
24+
25+
static __inline__ unsigned __attribute__((__always_inline__, __nodebug__))
26+
__riscv_clz_32(uint32_t __x) {
27+
return __builtin_riscv_clz_32(__x);
28+
}
29+
30+
static __inline__ unsigned __attribute__((__always_inline__, __nodebug__))
31+
__riscv_ctz_32(uint32_t __x) {
32+
return __builtin_riscv_ctz_32(__x);
33+
}
34+
35+
static __inline__ unsigned __attribute__((__always_inline__, __nodebug__))
36+
__riscv_cpop_32(uint32_t __x) {
37+
return __builtin_riscv_cpop_32(__x);
38+
}
39+
40+
#if __riscv_xlen == 64
41+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
42+
__riscv_orc_b_64(uint64_t __x) {
43+
return __builtin_riscv_orc_b_64(__x);
44+
}
45+
46+
static __inline__ unsigned __attribute__((__always_inline__, __nodebug__))
47+
__riscv_clz_64(uint64_t __x) {
48+
return __builtin_riscv_clz_64(__x);
49+
}
50+
51+
static __inline__ unsigned __attribute__((__always_inline__, __nodebug__))
52+
__riscv_ctz_64(uint64_t __x) {
53+
return __builtin_riscv_ctz_64(__x);
54+
}
55+
56+
static __inline__ unsigned __attribute__((__always_inline__, __nodebug__))
57+
__riscv_cpop_64(uint64_t __x) {
58+
return __builtin_riscv_cpop_64(__x);
59+
}
60+
#endif
61+
#endif // defined(__riscv_zbb)
62+
63+
#if defined(__riscv_zbb) || defined(__riscv_zbkb)
64+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
65+
__riscv_rev8_32(uint32_t __x) {
66+
return __builtin_bswap32(__x);
67+
}
68+
69+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
70+
__riscv_rol_32(uint32_t __x, uint32_t __y) {
71+
return __builtin_rotateleft32(__x, __y);
72+
}
73+
74+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
75+
__riscv_ror_32(uint32_t __x, uint32_t __y) {
76+
return __builtin_rotateright32(__x, __y);
77+
}
78+
79+
#if __riscv_xlen == 64
80+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
81+
__riscv_rev8_64(uint64_t __x) {
82+
return __builtin_bswap64(__x);
83+
}
84+
85+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
86+
__riscv_rol_64(uint64_t __x, uint32_t __y) {
87+
return __builtin_rotateleft64(__x, __y);
88+
}
89+
90+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
91+
__riscv_ror_64(uint64_t __x, uint32_t __y) {
92+
return __builtin_rotateright64(__x, __y);
93+
}
94+
#endif
95+
#endif // defined(__riscv_zbb) || defined(__riscv_zbkb)
96+
97+
#if defined(__riscv_zbkb)
98+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
99+
__riscv_brev8_32(uint32_t __x) {
100+
return __builtin_riscv_brev8_32(__x);
101+
}
102+
103+
#if __riscv_xlen == 64
104+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
105+
__riscv_brev8_64(uint64_t __x) {
106+
return __builtin_riscv_brev8_64(__x);
107+
}
108+
#endif
109+
110+
#if __riscv_xlen == 32
111+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
112+
__riscv_unzip_32(uint32_t __x) {
113+
return __builtin_riscv_unzip_32(__x);
114+
}
115+
116+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
117+
__riscv_zip_32(uint32_t __x) {
118+
return __builtin_riscv_zip_32(__x);
119+
}
120+
#endif
121+
#endif // defined(__riscv_zbkb)
122+
123+
#if defined(__riscv_zbkc)
124+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
125+
__riscv_clmul_32(uint32_t __x, uint32_t __y) {
126+
return __builtin_riscv_clmul_32(__x, __y);
127+
}
128+
129+
#if __riscv_xlen == 32
130+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
131+
__riscv_clmulh_32(uint32_t __x, uint32_t __y) {
132+
return __builtin_riscv_clmulh_32(__x, __y);
133+
}
134+
#endif
135+
136+
#if __riscv_xlen == 64
137+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
138+
__riscv_clmul_64(uint64_t __x, uint64_t __y) {
139+
return __builtin_riscv_clmul_64(__x, __y);
140+
}
141+
142+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
143+
__riscv_clmulh_64(uint64_t __x, uint64_t __y) {
144+
return __builtin_riscv_clmulh_64(__x, __y);
145+
}
146+
#endif
147+
#endif // defined(__riscv_zbkc)
148+
149+
#if defined(__riscv_zbkx)
150+
#if __riscv_xlen == 32
151+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
152+
__riscv_xperm4_32(uint32_t __x, uint32_t __y) {
153+
return __builtin_riscv_xperm4_32(__x, __y);
154+
}
155+
156+
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
157+
__riscv_xperm8_32(uint32_t __x, uint32_t __y) {
158+
return __builtin_riscv_xperm8_32(__x, __y);
159+
}
160+
#endif
161+
162+
#if __riscv_xlen == 64
163+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
164+
__riscv_xperm4_64(uint64_t __x, uint64_t __y) {
165+
return __builtin_riscv_xperm4_64(__x, __y);
166+
}
167+
168+
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
169+
__riscv_xperm8_64(uint64_t __x, uint64_t __y) {
170+
return __builtin_riscv_xperm8_64(__x, __y);
171+
}
172+
#endif
173+
#endif // defined(__riscv_zbkx)
174+
175+
#if defined(__cplusplus)
176+
}
177+
#endif
178+
179+
#endif

0 commit comments

Comments
 (0)