Skip to content

Commit b6bca4a

Browse files
authored
merge main into amd-staging (llvm#2838)
2 parents 25a6f7a + d36b0f7 commit b6bca4a

File tree

237 files changed

+5585
-2777
lines changed

Some content is hidden

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

237 files changed

+5585
-2777
lines changed

.ci/compute_projects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
DEPENDENT_RUNTIMES_TO_TEST = {
7878
"clang": {"compiler-rt"},
7979
"clang-tools-extra": {"libc"},
80+
"libc": {"libc"},
8081
".ci": {"compiler-rt", "libc"},
8182
}
8283
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {

.ci/compute_projects_test.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def test_top_level_file(self):
187187
self.assertEqual(env_variables["runtimes_check_targets"], "")
188188
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
189189

190-
def test_exclude_runtiems_in_projects(self):
190+
def test_exclude_libcxx_in_projects(self):
191191
env_variables = compute_projects.get_env_variables(
192192
["libcxx/CMakeLists.txt"], "Linux"
193193
)
@@ -197,6 +197,16 @@ def test_exclude_runtiems_in_projects(self):
197197
self.assertEqual(env_variables["runtimes_check_targets"], "")
198198
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
199199

200+
def test_include_libc_in_runtimes(self):
201+
env_variables = compute_projects.get_env_variables(
202+
["libc/CMakeLists.txt"], "Linux"
203+
)
204+
self.assertEqual(env_variables["projects_to_build"], "clang;lld")
205+
self.assertEqual(env_variables["project_check_targets"], "")
206+
self.assertEqual(env_variables["runtimes_to_build"], "libc")
207+
self.assertEqual(env_variables["runtimes_check_targets"], "check-libc")
208+
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
209+
200210
def test_exclude_docs(self):
201211
env_variables = compute_projects.get_env_variables(
202212
["llvm/docs/CIBestPractices.rst"], "Linux"

clang/bindings/python/tests/cindex/test_file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
inputs_dir = os.path.join(os.path.dirname(__file__), "INPUTS")
1111

12+
1213
class TestFile(unittest.TestCase):
1314
def test_file(self):
1415
index = Index.create()

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ TARGET_HEADER_BUILTIN(_InterlockedIncrement64, "LLiLLiD*", "nh", INTRIN_H,
155155
TARGET_HEADER_BUILTIN(_InterlockedOr64, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
156156
TARGET_HEADER_BUILTIN(_InterlockedXor64, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
157157

158+
TARGET_HEADER_BUILTIN(_InterlockedAdd_acq, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
159+
TARGET_HEADER_BUILTIN(_InterlockedAdd_rel, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
160+
TARGET_HEADER_BUILTIN(_InterlockedAdd_nf, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
161+
TARGET_HEADER_BUILTIN(_InterlockedAdd64_acq, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
162+
TARGET_HEADER_BUILTIN(_InterlockedAdd64_rel, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
163+
TARGET_HEADER_BUILTIN(_InterlockedAdd64_nf, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
164+
158165
TARGET_HEADER_BUILTIN(_InterlockedExchangeAdd_acq, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
159166
TARGET_HEADER_BUILTIN(_InterlockedExchangeAdd_rel, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
160167
TARGET_HEADER_BUILTIN(_InterlockedExchangeAdd_nf, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,5 +647,8 @@ TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_f16_f32, "V2hV2hfUiIb", "nc", "f32-to-f16
647647

648648
TARGET_BUILTIN(__builtin_amdgcn_s_setprio_inc_wg, "vIs", "n", "setprio-inc-wg-inst")
649649

650+
TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_f16_fp8, "V2hs", "nc", "gfx1250-insts")
651+
TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_f16_bf8, "V2hs", "nc", "gfx1250-insts")
652+
650653
#undef BUILTIN
651654
#undef TARGET_BUILTIN

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,8 @@ def note_unsatisfied_trait
17681768
"%TriviallyRelocatable{trivially relocatable}|"
17691769
"%Replaceable{replaceable}|"
17701770
"%TriviallyCopyable{trivially copyable}|"
1771-
"%Empty{empty}"
1771+
"%Empty{empty}|"
1772+
"%StandardLayout{standard-layout}"
17721773
"}1">;
17731774

17741775
def note_unsatisfied_trait_reason
@@ -1792,6 +1793,12 @@ def note_unsatisfied_trait_reason
17921793
"%VirtualFunction{has a virtual function %1}|"
17931794
"%NonEmptyBase{has a base class %1 that is not empty}|"
17941795
"%NonZeroLengthField{field %1 is a non-zero-length bit-field}|"
1796+
"%NonStandardLayoutBase{has a non-standard-layout base %1}|"
1797+
"%MixedAccess{has mixed access specifiers}|"
1798+
"%MixedAccessField{field %1 has a different access specifier than field %2}|"
1799+
"%MultipleDataBase{has multiple base classes with data members}|"
1800+
"%NonStandardLayoutMember{has a non-standard-layout member %1 of type %2}|"
1801+
"%IndirectBaseWithFields{has an indirect base %1 with data members}|"
17951802
"%DeletedDtr{has a %select{deleted|user-provided}1 destructor}|"
17961803
"%UserProvidedCtr{has a user provided %select{copy|move}1 "
17971804
"constructor}|"

clang/include/clang/Basic/Sanitizers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ bool parseSanitizerWeightedValue(StringRef Value, bool AllowGroups,
218218
void serializeSanitizerSet(SanitizerSet Set,
219219
SmallVectorImpl<StringRef> &Values);
220220

221-
/// Serialize a SanitizerMaskCutoffs into values for -fsanitize= or
222-
/// -fno-sanitize=.
221+
/// Serialize a SanitizerMaskCutoffs into command line arguments.
223222
void serializeSanitizerMaskCutoffs(const SanitizerMaskCutoffs &Cutoffs,
224223
SmallVectorImpl<std::string> &Values);
225224

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -159,92 +159,92 @@ struct MissingFeatures {
159159
static bool addressPointerAuthInfo() { return false; }
160160

161161
// Misc
162-
static bool cirgenABIInfo() { return false; }
163162
static bool abiArgInfo() { return false; }
164-
static bool tryEmitAsConstant() { return false; }
165-
static bool constructABIArgDirectExtend() { return false; }
166-
static bool opGlobalViewAttr() { return false; }
167-
static bool lowerModeOptLevel() { return false; }
168-
static bool opTBAA() { return false; }
169-
static bool objCLifetime() { return false; }
170-
static bool objCBlocks() { return false; }
171-
static bool emitNullabilityCheck() { return false; }
172-
static bool emitLValueAlignmentAssumption() { return false; }
173-
static bool emitLifetimeMarkers() { return false; }
174-
static bool astVarDeclInterface() { return false; }
175-
static bool stackSaveOp() { return false; }
163+
static bool addHeapAllocSiteMetadata() { return false; }
176164
static bool aggValueSlot() { return false; }
177-
static bool aggValueSlotMayOverlap() { return false; }
178-
static bool aggValueSlotVolatile() { return false; }
179-
static bool aggValueSlotDestructedFlag() { return false; }
180165
static bool aggValueSlotAlias() { return false; }
166+
static bool aggValueSlotDestructedFlag() { return false; }
181167
static bool aggValueSlotGC() { return false; }
182-
static bool generateDebugInfo() { return false; }
183-
static bool pointerOverflowSanitizer() { return false; }
184-
static bool fpConstraints() { return false; }
185-
static bool sanitizers() { return false; }
186-
static bool addHeapAllocSiteMetadata() { return false; }
187-
static bool targetCIRGenInfoArch() { return false; }
188-
static bool targetCIRGenInfoOS() { return false; }
189-
static bool targetCodeGenInfoGetNullPointer() { return false; }
190-
static bool loopInfoStack() { return false; }
191-
static bool requiresCleanups() { return false; }
192-
static bool createProfileWeightsForLoop() { return false; }
193-
static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
194-
static bool pgoUse() { return false; }
195-
static bool cgFPOptionsRAII() { return false; }
196-
static bool metaDataNode() { return false; }
197-
static bool fastMathFlags() { return false; }
168+
static bool aggValueSlotMayOverlap() { return false; }
169+
static bool aggValueSlotVolatile() { return false; }
198170
static bool alignCXXRecordDecl() { return false; }
199-
static bool setNonGC() { return false; }
200-
static bool incrementProfileCounter() { return false; }
201-
static bool insertBuiltinUnpredictable() { return false; }
202-
static bool objCGC() { return false; }
203-
static bool weakRefReference() { return false; }
204-
static bool hip() { return false; }
205-
static bool setObjCGCLValueClass() { return false; }
206-
static bool setDLLStorageClass() { return false; }
207-
static bool openMP() { return false; }
208-
static bool emitCheckedInBoundsGEP() { return false; }
209-
static bool preservedAccessIndexRegion() { return false; }
171+
static bool armComputeVolatileBitfields() { return false; }
172+
static bool asmLabelAttr() { return false; }
173+
static bool astVarDeclInterface() { return false; }
174+
static bool attributeNoBuiltin() { return false; }
210175
static bool bitfields() { return false; }
211-
static bool msabi() { return false; }
212-
static bool typeChecks() { return false; }
213-
static bool lambdaFieldToName() { return false; }
214-
static bool moduleNameHash() { return false; }
215-
static bool constantFoldSwitchStatement() { return false; }
216-
static bool cudaSupport() { return false; }
217-
static bool maybeHandleStaticInExternC() { return false; }
176+
static bool builtinCall() { return false; }
177+
static bool builtinCallF128() { return false; }
178+
static bool builtinCallMathErrno() { return false; }
179+
static bool cgFPOptionsRAII() { return false; }
180+
static bool cirgenABIInfo() { return false; }
181+
static bool cleanupAfterErrorDiags() { return false; }
182+
static bool cleanupsToDeactivate() { return false; }
218183
static bool constEmitterArrayILE() { return false; }
219184
static bool constEmitterVectorILE() { return false; }
220-
static bool needsGlobalCtorDtor() { return false; }
221-
static bool emitTypeCheck() { return false; }
222-
static bool writebacks() { return false; }
223-
static bool cleanupsToDeactivate() { return false; }
224-
static bool stackBase() { return false; }
225-
static bool deferredCXXGlobalInit() { return false; }
226-
static bool setTargetAttributes() { return false; }
185+
static bool constantFoldSwitchStatement() { return false; }
186+
static bool constructABIArgDirectExtend() { return false; }
227187
static bool coverageMapping() { return false; }
228-
static bool peepholeProtection() { return false; }
229-
static bool instrumentation() { return false; }
230-
static bool cleanupAfterErrorDiags() { return false; }
188+
static bool createProfileWeightsForLoop() { return false; }
189+
static bool ctorMemcpyizer() { return false; }
190+
static bool cudaSupport() { return false; }
231191
static bool cxxRecordStaticMembers() { return false; }
232-
static bool isMemcpyEquivalentSpecialMember() { return false; }
233-
static bool isTrivialCtorOrDtor() { return false; }
192+
static bool dataLayoutTypeAllocSize() { return false; }
193+
static bool deferredCXXGlobalInit() { return false; }
194+
static bool emitCheckedInBoundsGEP() { return false; }
195+
static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
196+
static bool emitLifetimeMarkers() { return false; }
197+
static bool emitLValueAlignmentAssumption() { return false; }
198+
static bool emitNullabilityCheck() { return false; }
199+
static bool emitTypeCheck() { return false; }
200+
static bool fastMathFlags() { return false; }
201+
static bool fpConstraints() { return false; }
202+
static bool generateDebugInfo() { return false; }
203+
static bool hip() { return false; }
234204
static bool implicitConstructorArgs() { return false; }
205+
static bool incrementProfileCounter() { return false; }
206+
static bool insertBuiltinUnpredictable() { return false; }
207+
static bool instrumentation() { return false; }
235208
static bool intrinsics() { return false; }
236-
static bool attributeNoBuiltin() { return false; }
237-
static bool thunks() { return false; }
238-
static bool runCleanupsScope() { return false; }
209+
static bool isMemcpyEquivalentSpecialMember() { return false; }
210+
static bool isTrivialCtorOrDtor() { return false; }
211+
static bool lambdaFieldToName() { return false; }
212+
static bool loopInfoStack() { return false; }
239213
static bool lowerAggregateLoadStore() { return false; }
240-
static bool dataLayoutTypeAllocSize() { return false; }
241-
static bool asmLabelAttr() { return false; }
242-
static bool builtinCall() { return false; }
243-
static bool builtinCallF128() { return false; }
244-
static bool builtinCallMathErrno() { return false; }
214+
static bool lowerModeOptLevel() { return false; }
215+
static bool maybeHandleStaticInExternC() { return false; }
216+
static bool metaDataNode() { return false; }
217+
static bool moduleNameHash() { return false; }
218+
static bool msabi() { return false; }
219+
static bool needsGlobalCtorDtor() { return false; }
245220
static bool nonFineGrainedBitfields() { return false; }
246-
static bool armComputeVolatileBitfields() { return false; }
247-
static bool ctorMemcpyizer() { return false; }
221+
static bool objCBlocks() { return false; }
222+
static bool objCGC() { return false; }
223+
static bool objCLifetime() { return false; }
224+
static bool openMP() { return false; }
225+
static bool opGlobalViewAttr() { return false; }
226+
static bool opTBAA() { return false; }
227+
static bool peepholeProtection() { return false; }
228+
static bool pgoUse() { return false; }
229+
static bool pointerOverflowSanitizer() { return false; }
230+
static bool preservedAccessIndexRegion() { return false; }
231+
static bool requiresCleanups() { return false; }
232+
static bool runCleanupsScope() { return false; }
233+
static bool sanitizers() { return false; }
234+
static bool setDLLStorageClass() { return false; }
235+
static bool setNonGC() { return false; }
236+
static bool setObjCGCLValueClass() { return false; }
237+
static bool setTargetAttributes() { return false; }
238+
static bool stackBase() { return false; }
239+
static bool stackSaveOp() { return false; }
240+
static bool targetCIRGenInfoArch() { return false; }
241+
static bool targetCIRGenInfoOS() { return false; }
242+
static bool targetCodeGenInfoGetNullPointer() { return false; }
243+
static bool thunks() { return false; }
244+
static bool tryEmitAsConstant() { return false; }
245+
static bool typeChecks() { return false; }
246+
static bool weakRefReference() { return false; }
247+
static bool writebacks() { return false; }
248248

249249
// Missing types
250250
static bool dataMemberType() { return false; }

clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,6 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd, cir::RecordType *ty) {
614614
}
615615
}
616616

617-
if (llvm::isa<CXXRecordDecl>(rd) && !rd->isUnion() &&
618-
!rd->hasAttr<FinalAttr>()) {
619-
if (lowering.astRecordLayout.getNonVirtualSize() !=
620-
lowering.astRecordLayout.getSize()) {
621-
cgm.errorNYI(rd->getSourceRange(), "computeRecordLayout: CXXRecordDecl");
622-
}
623-
}
624-
625617
// Fill in the record *after* computing the base type. Filling in the body
626618
// signifies that the type is no longer opaque and record layout is complete,
627619
// but we may need to recursively layout rd while laying D out as a base type.

clang/lib/CodeGen/TargetBuiltins/ARM.cpp

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6499,12 +6499,38 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
64996499
}
65006500

65016501
case clang::AArch64::BI_InterlockedAdd:
6502-
case clang::AArch64::BI_InterlockedAdd64: {
6502+
case clang::AArch64::BI_InterlockedAdd_acq:
6503+
case clang::AArch64::BI_InterlockedAdd_rel:
6504+
case clang::AArch64::BI_InterlockedAdd_nf:
6505+
case clang::AArch64::BI_InterlockedAdd64:
6506+
case clang::AArch64::BI_InterlockedAdd64_acq:
6507+
case clang::AArch64::BI_InterlockedAdd64_rel:
6508+
case clang::AArch64::BI_InterlockedAdd64_nf: {
65036509
Address DestAddr = CheckAtomicAlignment(*this, E);
65046510
Value *Val = EmitScalarExpr(E->getArg(1));
6511+
llvm::AtomicOrdering Ordering;
6512+
switch (BuiltinID) {
6513+
case clang::AArch64::BI_InterlockedAdd:
6514+
case clang::AArch64::BI_InterlockedAdd64:
6515+
Ordering = llvm::AtomicOrdering::SequentiallyConsistent;
6516+
break;
6517+
case clang::AArch64::BI_InterlockedAdd_acq:
6518+
case clang::AArch64::BI_InterlockedAdd64_acq:
6519+
Ordering = llvm::AtomicOrdering::Acquire;
6520+
break;
6521+
case clang::AArch64::BI_InterlockedAdd_rel:
6522+
case clang::AArch64::BI_InterlockedAdd64_rel:
6523+
Ordering = llvm::AtomicOrdering::Release;
6524+
break;
6525+
case clang::AArch64::BI_InterlockedAdd_nf:
6526+
case clang::AArch64::BI_InterlockedAdd64_nf:
6527+
Ordering = llvm::AtomicOrdering::Monotonic;
6528+
break;
6529+
default:
6530+
llvm_unreachable("missing builtin ID in switch!");
6531+
}
65056532
AtomicRMWInst *RMWI =
6506-
Builder.CreateAtomicRMW(AtomicRMWInst::Add, DestAddr, Val,
6507-
llvm::AtomicOrdering::SequentiallyConsistent);
6533+
Builder.CreateAtomicRMW(AtomicRMWInst::Add, DestAddr, Val, Ordering);
65086534
return Builder.CreateAdd(RMWI, Val);
65096535
}
65106536
}

0 commit comments

Comments
 (0)