Skip to content

Commit 70417bd

Browse files
committed
Merge from 'main' to 'sycl-web' (#2)
Reference commit: ad05778 [clang-offload-bundler] Add new unbundling mode 'a' for archives (intel#2840) Also added an override keyword that was missed during eda76af. CONFLICT (content): Merge conflict in clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp CONFLICT (content): Merge conflict in clang/test/Driver/clang-offload-bundler.c
2 parents f2e4dc2 + f7ce532 commit 70417bd

File tree

332 files changed

+6676
-3085
lines changed

Some content is hidden

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

332 files changed

+6676
-3085
lines changed

clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ static inline std::string formatMixFlags(MixFlags F) {
167167
return Str.str().str();
168168
}
169169

170-
#else
171-
172-
static inline std::string formatMixFlags(MixFlags F);
173-
174170
#endif // NDEBUG
175171

176172
/// The results of the steps of an Implicit Conversion Sequence is saved in

clang/docs/ClangOffloadBundler.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ Where:
121121
============= ==============================================================
122122

123123
**target-triple**
124-
The target triple of the code object.
124+
The target triple of the code object:
125+
126+
.. code::
127+
128+
<Architecture>-<Vendor>-<OS>-<Environment>
129+
130+
It is required to have all four components present, if target-id is present.
131+
Components are hyphen separated. If a component is not specified then the
132+
empty string must be used in its place.
125133

126134
**target-id**
127135
The canonical target ID of the code object. Present only if the target

clang/include/clang/Basic/BuiltinsNVPTX.def

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,29 @@ TARGET_BUILTIN(__imma_m8n8k32_mma_s4, "vi*iC*iC*iC*IiIi", "", AND(SM_75,PTX63))
762762
TARGET_BUILTIN(__imma_m8n8k32_mma_u4, "vi*iC*iC*iC*IiIi", "", AND(SM_75,PTX63))
763763
TARGET_BUILTIN(__imma_m8n8k32_st_c_i32, "vi*iC*UiIi", "", AND(SM_75,PTX63))
764764

765+
// Builtins to support double and alternate float WMMA instructions on sm_80
766+
TARGET_BUILTIN(__dmma_m8n8k4_ld_a, "vd*dC*UiIi", "", AND(SM_80,PTX70))
767+
TARGET_BUILTIN(__dmma_m8n8k4_ld_b, "vd*dC*UiIi", "", AND(SM_80,PTX70))
768+
TARGET_BUILTIN(__dmma_m8n8k4_ld_c, "vd*dC*UiIi", "", AND(SM_80,PTX70))
769+
TARGET_BUILTIN(__dmma_m8n8k4_st_c_f64, "vd*dC*UiIi", "", AND(SM_80,PTX70))
770+
TARGET_BUILTIN(__dmma_m8n8k4_mma_f64, "vd*dC*dC*dC*IiIi", "", AND(SM_80,PTX70))
771+
772+
TARGET_BUILTIN(__mma_bf16_m16n16k16_ld_a, "vi*iC*UiIi", "", AND(SM_80,PTX70))
773+
TARGET_BUILTIN(__mma_bf16_m16n16k16_ld_b, "vi*iC*UiIi", "", AND(SM_80,PTX70))
774+
TARGET_BUILTIN(__mma_bf16_m16n16k16_mma_f32, "vf*iC*iC*fC*IiIi", "", AND(SM_80,PTX70))
775+
TARGET_BUILTIN(__mma_bf16_m8n32k16_ld_a, "vi*iC*UiIi", "", AND(SM_80,PTX70))
776+
TARGET_BUILTIN(__mma_bf16_m8n32k16_ld_b, "vi*iC*UiIi", "", AND(SM_80,PTX70))
777+
TARGET_BUILTIN(__mma_bf16_m8n32k16_mma_f32, "vf*iC*iC*fC*IiIi", "", AND(SM_80,PTX70))
778+
TARGET_BUILTIN(__mma_bf16_m32n8k16_ld_a, "vi*iC*UiIi", "", AND(SM_80,PTX70))
779+
TARGET_BUILTIN(__mma_bf16_m32n8k16_ld_b, "vi*iC*UiIi", "", AND(SM_80,PTX70))
780+
TARGET_BUILTIN(__mma_bf16_m32n8k16_mma_f32, "vf*iC*iC*fC*IiIi", "", AND(SM_80,PTX70))
781+
782+
TARGET_BUILTIN(__mma_tf32_m16n16k8_ld_a, "vi*iC*UiIi", "", AND(SM_80,PTX70))
783+
TARGET_BUILTIN(__mma_tf32_m16n16k8_ld_b, "vi*iC*UiIi", "", AND(SM_80,PTX70))
784+
TARGET_BUILTIN(__mma_tf32_m16n16k8_ld_c, "vf*fC*UiIi", "", AND(SM_80,PTX70))
785+
TARGET_BUILTIN(__mma_m16n16k8_st_c_f32, "vf*fC*UiIi", "", AND(SM_80,PTX70))
786+
TARGET_BUILTIN(__mma_tf32_m16n16k8_mma_f32, "vf*iC*iC*fC*IiIi", "", AND(SM_80,PTX70))
787+
765788
// Async Copy
766789
TARGET_BUILTIN(__nvvm_cp_async_mbarrier_arrive, "vWi*", "", AND(SM_80,PTX70))
767790
TARGET_BUILTIN(__nvvm_cp_async_mbarrier_arrive_shared, "vWi*3", "", AND(SM_80,PTX70))

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7489,6 +7489,12 @@ def warn_deprecated_volatile_structured_binding : Warning<
74897489
"volatile qualifier in structured binding declaration is deprecated">,
74907490
InGroup<DeprecatedVolatile>;
74917491

7492+
def warn_deprecated_altivec_src_compat : Warning<
7493+
"Current handling of vector bool and vector pixel types in this context are "
7494+
"deprecated. The default behaviour will soon change to that implied by the "
7495+
"'-altivec-compat=xl' option">,
7496+
InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
7497+
74927498
def err_catch_incomplete_ptr : Error<
74937499
"cannot catch pointer to incomplete type %0">;
74947500
def err_catch_incomplete_ref : Error<

clang/include/clang/Basic/LangOptions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ LANGOPT(WritableStrings , 1, 0, "writable string support")
126126
LANGOPT(ConstStrings , 1, 0, "const-qualified string support")
127127
ENUM_LANGOPT(LaxVectorConversions, LaxVectorConversionKind, 2,
128128
LaxVectorConversionKind::All, "lax vector conversions")
129+
ENUM_LANGOPT(AltivecSrcCompat, AltivecSrcCompatKind, 2,
130+
AltivecSrcCompatKind::Default, "Altivec source compatibility")
129131
LANGOPT(ConvergentFunctions, 1, 1, "Assume convergent functions")
130132
LANGOPT(AltiVec , 1, 0, "AltiVec-style vector initializers")
131133
LANGOPT(ZVector , 1, 0, "System z vector extensions")

clang/include/clang/Basic/LangOptions.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,18 @@ class LangOptions : public LangOptionsBase {
249249
All,
250250
};
251251

252+
enum class AltivecSrcCompatKind {
253+
// All vector compares produce scalars except vector pixel and vector bool.
254+
// The types vector pixel and vector bool return vector results.
255+
Mixed,
256+
// All vector compares produce vector results as in GCC.
257+
GCC,
258+
// All vector compares produce scalars as in XL.
259+
XL,
260+
// Default clang behaviour.
261+
Default = Mixed,
262+
};
263+
252264
enum class SignReturnAddressScopeKind {
253265
/// No signing for any function.
254266
None,

clang/include/clang/Driver/Options.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3912,6 +3912,18 @@ def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
39123912
def v : Flag<["-"], "v">, Flags<[CC1Option, CoreOption]>,
39133913
HelpText<"Show commands to run and use verbose output">,
39143914
MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
3915+
def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
3916+
Flags<[CC1Option]>, Group<f_Group>,
3917+
HelpText<"Source-level compatibility for Altivec vectors (for PowerPC "
3918+
"targets). This includes results of vector comparison (scalar for "
3919+
"'xl', vector for 'gcc') as well as behavior when initializing with "
3920+
"a scalar (splatting for 'xl', element zero only for 'gcc'). For "
3921+
"'mixed', the compatibility is as 'gcc' for 'vector bool/vector "
3922+
"pixel' and as 'xl' for other types. Current default is 'mixed'.">,
3923+
Values<"mixed,gcc,xl">,
3924+
NormalizedValuesScope<"LangOptions::AltivecSrcCompatKind">,
3925+
NormalizedValues<["Mixed", "GCC", "XL"]>,
3926+
MarshallingInfoEnum<LangOpts<"AltivecSrcCompat">, "Mixed">;
39153927
def verify_debug_info : Flag<["--"], "verify-debug-info">, Flags<[NoXarchOption]>,
39163928
HelpText<"Verify the binary representation of debug output">;
39173929
def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>;

clang/lib/Analysis/ThreadSafety.cpp

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ class LockableFactEntry : public FactEntry {
865865
handleRemovalFromIntersection(const FactSet &FSet, FactManager &FactMan,
866866
SourceLocation JoinLoc, LockErrorKind LEK,
867867
ThreadSafetyHandler &Handler) const override {
868-
if (!managed() && !asserted() && !negative() && !isUniversal()) {
868+
if (!asserted() && !negative() && !isUniversal()) {
869869
Handler.handleMutexHeldEndOfScope("mutex", toString(), loc(), JoinLoc,
870870
LEK);
871871
}
@@ -1052,13 +1052,13 @@ class ThreadSafetyAnalyzer {
10521052

10531053
bool join(const FactEntry &a, const FactEntry &b);
10541054

1055-
void intersectAndWarn(FactSet &FSet1, const FactSet &FSet2,
1056-
SourceLocation JoinLoc, LockErrorKind LEK1,
1057-
LockErrorKind LEK2);
1055+
void intersectAndWarn(FactSet &EntrySet, const FactSet &ExitSet,
1056+
SourceLocation JoinLoc, LockErrorKind EntryLEK,
1057+
LockErrorKind ExitLEK);
10581058

1059-
void intersectAndWarn(FactSet &FSet1, const FactSet &FSet2,
1060-
SourceLocation JoinLoc, LockErrorKind LEK1) {
1061-
intersectAndWarn(FSet1, FSet2, JoinLoc, LEK1, LEK1);
1059+
void intersectAndWarn(FactSet &EntrySet, const FactSet &ExitSet,
1060+
SourceLocation JoinLoc, LockErrorKind LEK) {
1061+
intersectAndWarn(EntrySet, ExitSet, JoinLoc, LEK, LEK);
10621062
}
10631063

10641064
void runAnalysis(AnalysisDeclContext &AC);
@@ -2219,42 +2219,44 @@ bool ThreadSafetyAnalyzer::join(const FactEntry &A, const FactEntry &B) {
22192219
/// are the same. In the event of a difference, we use the intersection of these
22202220
/// two locksets at the start of D.
22212221
///
2222-
/// \param FSet1 The first lockset.
2223-
/// \param FSet2 The second lockset.
2222+
/// \param EntrySet A lockset for entry into a (possibly new) block.
2223+
/// \param ExitSet The lockset on exiting a preceding block.
22242224
/// \param JoinLoc The location of the join point for error reporting
2225-
/// \param LEK1 The error message to report if a mutex is missing from LSet1
2226-
/// \param LEK2 The error message to report if a mutex is missing from Lset2
2227-
void ThreadSafetyAnalyzer::intersectAndWarn(FactSet &FSet1,
2228-
const FactSet &FSet2,
2225+
/// \param EntryLEK The warning if a mutex is missing from \p EntrySet.
2226+
/// \param ExitLEK The warning if a mutex is missing from \p ExitSet.
2227+
void ThreadSafetyAnalyzer::intersectAndWarn(FactSet &EntrySet,
2228+
const FactSet &ExitSet,
22292229
SourceLocation JoinLoc,
2230-
LockErrorKind LEK1,
2231-
LockErrorKind LEK2) {
2232-
FactSet FSet1Orig = FSet1;
2233-
2234-
// Find locks in FSet2 that conflict or are not in FSet1, and warn.
2235-
for (const auto &Fact : FSet2) {
2236-
const FactEntry &LDat2 = FactMan[Fact];
2237-
2238-
FactSet::iterator Iter1 = FSet1.findLockIter(FactMan, LDat2);
2239-
if (Iter1 != FSet1.end()) {
2240-
if (join(FactMan[*Iter1], LDat2) && LEK1 == LEK_LockedSomePredecessors)
2241-
*Iter1 = Fact;
2242-
} else {
2243-
LDat2.handleRemovalFromIntersection(FSet2, FactMan, JoinLoc, LEK1,
2244-
Handler);
2230+
LockErrorKind EntryLEK,
2231+
LockErrorKind ExitLEK) {
2232+
FactSet EntrySetOrig = EntrySet;
2233+
2234+
// Find locks in ExitSet that conflict or are not in EntrySet, and warn.
2235+
for (const auto &Fact : ExitSet) {
2236+
const FactEntry &ExitFact = FactMan[Fact];
2237+
2238+
FactSet::iterator EntryIt = EntrySet.findLockIter(FactMan, ExitFact);
2239+
if (EntryIt != EntrySet.end()) {
2240+
if (join(FactMan[*EntryIt], ExitFact) &&
2241+
EntryLEK == LEK_LockedSomePredecessors)
2242+
*EntryIt = Fact;
2243+
} else if (!ExitFact.managed()) {
2244+
ExitFact.handleRemovalFromIntersection(ExitSet, FactMan, JoinLoc,
2245+
EntryLEK, Handler);
22452246
}
22462247
}
22472248

2248-
// Find locks in FSet1 that are not in FSet2, and remove them.
2249-
for (const auto &Fact : FSet1Orig) {
2250-
const FactEntry *LDat1 = &FactMan[Fact];
2251-
const FactEntry *LDat2 = FSet2.findLock(FactMan, *LDat1);
2249+
// Find locks in EntrySet that are not in ExitSet, and remove them.
2250+
for (const auto &Fact : EntrySetOrig) {
2251+
const FactEntry *EntryFact = &FactMan[Fact];
2252+
const FactEntry *ExitFact = ExitSet.findLock(FactMan, *EntryFact);
22522253

2253-
if (!LDat2) {
2254-
LDat1->handleRemovalFromIntersection(FSet1Orig, FactMan, JoinLoc, LEK2,
2255-
Handler);
2256-
if (LEK2 == LEK_LockedSomePredecessors)
2257-
FSet1.removeLock(FactMan, *LDat1);
2254+
if (!ExitFact) {
2255+
if (!EntryFact->managed() || ExitLEK == LEK_LockedSomeLoopIterations)
2256+
EntryFact->handleRemovalFromIntersection(EntrySetOrig, FactMan, JoinLoc,
2257+
ExitLEK, Handler);
2258+
if (ExitLEK == LEK_LockedSomePredecessors)
2259+
EntrySet.removeLock(FactMan, *EntryFact);
22582260
}
22592261
}
22602262
}
@@ -2528,7 +2530,7 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
25282530
CFGBlock *FirstLoopBlock = *SI;
25292531
CFGBlockInfo *PreLoop = &BlockInfo[FirstLoopBlock->getBlockID()];
25302532
CFGBlockInfo *LoopEnd = &BlockInfo[CurrBlockID];
2531-
intersectAndWarn(LoopEnd->ExitSet, PreLoop->EntrySet, PreLoop->EntryLoc,
2533+
intersectAndWarn(PreLoop->EntrySet, LoopEnd->ExitSet, PreLoop->EntryLoc,
25322534
LEK_LockedSomeLoopIterations);
25332535
}
25342536
}

clang/lib/Basic/Targets/NVPTX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class LLVM_LIBRARY_VISIBILITY NVPTXTargetInfo : public TargetInfo {
179179
return CCCR_Warning;
180180
}
181181

182-
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts) {
182+
void adjust(DiagnosticsEngine &Diags, LangOptions &Opts) override {
183183
TargetInfo::adjust(Diags, Opts);
184184
// FIXME: Needed for compiling SYCL to PTX.
185185
TLSSupported = TLSSupported || Opts.SYCLIsDevice;

0 commit comments

Comments
 (0)