Skip to content

Commit 1ccf47d

Browse files
committed
Merge from 'main' to 'sycl-web' (#2)
CONFLICT (content): Merge conflict in clang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_simd_codegen.cpp
2 parents ca2ca82 + e9c7291 commit 1ccf47d

File tree

1,399 files changed

+361072
-305543
lines changed

Some content is hidden

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

1,399 files changed

+361072
-305543
lines changed

clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Command {
9191
// By resetting the parser options, we lost the standard -help flag.
9292
llvm::cl::opt<bool, false, llvm::cl::parser<bool>> Help{
9393
"help", llvm::cl::desc("Display available options"),
94-
llvm::cl::ValueDisallowed, llvm::cl::cat(llvm::cl::GeneralCategory)};
94+
llvm::cl::ValueDisallowed, llvm::cl::cat(llvm::cl::getGeneralCategory())};
9595
// FIXME: Allow commands to signal failure.
9696
virtual void run() = 0;
9797

clang-tools-extra/clangd/indexer/IndexerMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int main(int argc, const char **argv) {
124124
)";
125125

126126
auto Executor = clang::tooling::createExecutorFromCommandLineArgs(
127-
argc, argv, llvm::cl::GeneralCategory, Overview);
127+
argc, argv, llvm::cl::getGeneralCategory(), Overview);
128128

129129
if (!Executor) {
130130
llvm::errs() << llvm::toString(Executor.takeError()) << "\n";

clang/docs/AddressSanitizer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ By default AddressSanitizer inlines the instumentation code to improve the
286286
run-time performance, which leads to increased binary size. Using the
287287
(clang flag ``-fsanitize-address-outline-instrumentation` default: ``false``)
288288
flag forces all code instumentation to be outlined, which reduces the size
289-
of the binary, but also reduces the run-time performace.
289+
of the generated code, but also reduces the run-time performace.
290290

291291
Limitations
292292
===========

clang/docs/LibASTMatchersReference.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7701,7 +7701,7 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
77017701
While
77027702
varDecl(hasInitializer(integerLiteral()))
77037703
varDecl(hasInitializer(declRefExpr()))
7704-
only match the declarations for b, c, and d.
7704+
only match the declarations for a.
77057705
</pre></td></tr>
77067706

77077707

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ AST_MATCHER_P(Expr, ignoringImplicit, internal::Matcher<Expr>,
913913
/// varDecl(hasInitializer(integerLiteral()))
914914
/// varDecl(hasInitializer(declRefExpr()))
915915
/// \endcode
916-
/// only match the declarations for b, c, and d.
916+
/// only match the declarations for a.
917917
AST_MATCHER_P(Expr, ignoringImpCasts,
918918
internal::Matcher<Expr>, InnerMatcher) {
919919
return InnerMatcher.matches(*Node.IgnoreImpCasts(), Finder, Builder);

clang/include/clang/Basic/BuiltinsNVPTX.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ TARGET_BUILTIN(__hmma_m8n32k16_mma_f16f32, "vi*iC*iC*fC*IiIi", "", AND(SM_70,PTX
727727
TARGET_BUILTIN(__bmma_m8n8k128_ld_a_b1, "vi*iC*UiIi", "", AND(SM_75,PTX63))
728728
TARGET_BUILTIN(__bmma_m8n8k128_ld_b_b1, "vi*iC*UiIi", "", AND(SM_75,PTX63))
729729
TARGET_BUILTIN(__bmma_m8n8k128_ld_c, "vi*iC*UiIi", "", AND(SM_75,PTX63))
730+
TARGET_BUILTIN(__bmma_m8n8k128_mma_and_popc_b1, "vi*iC*iC*iC*Ii", "", AND(SM_75,PTX71))
730731
TARGET_BUILTIN(__bmma_m8n8k128_mma_xor_popc_b1, "vi*iC*iC*iC*Ii", "", AND(SM_75,PTX63))
731732
TARGET_BUILTIN(__bmma_m8n8k128_st_c_i32, "vi*iC*UiIi", "", AND(SM_75,PTX63))
732733
TARGET_BUILTIN(__imma_m16n16k16_ld_a_s8, "vi*iC*UiIi", "", AND(SM_72,PTX63))

clang/include/clang/Basic/BuiltinsPPC.def

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
#define UNALIASED_CUSTOM_BUILTIN(ID, TYPES, ACCUMULATE) \
3030
CUSTOM_BUILTIN(ID, ID, TYPES, ACCUMULATE)
3131

32-
// builtins for compatibility with the XL compiler
32+
// XL Compatibility built-ins
3333
BUILTIN(__builtin_ppc_popcntb, "ULiULi", "")
34+
BUILTIN(__builtin_ppc_poppar4, "iUi", "")
35+
BUILTIN(__builtin_ppc_poppar8, "iULLi", "")
3436
BUILTIN(__builtin_ppc_eieio, "v", "")
3537
BUILTIN(__builtin_ppc_iospace_eieio, "v", "")
3638
BUILTIN(__builtin_ppc_isync, "v", "")
@@ -83,6 +85,33 @@ BUILTIN(__builtin_ppc_mulhwu, "UiUiUi", "")
8385
BUILTIN(__builtin_ppc_maddhd, "LLiLLiLLiLLi", "")
8486
BUILTIN(__builtin_ppc_maddhdu, "ULLiULLiULLiULLi", "")
8587
BUILTIN(__builtin_ppc_maddld, "LLiLLiLLiLLi", "")
88+
// Rotate
89+
BUILTIN(__builtin_ppc_rlwnm, "UiUiIUiIUi", "")
90+
BUILTIN(__builtin_ppc_rlwimi, "UiUiUiIUiIUi", "")
91+
BUILTIN(__builtin_ppc_rldimi, "ULLiULLiULLiIUiIULLi", "")
92+
// load
93+
BUILTIN(__builtin_ppc_load2r, "UiUs*", "")
94+
BUILTIN(__builtin_ppc_load4r, "UiUi*", "")
95+
BUILTIN(__builtin_ppc_load8r, "ULLiULLi*", "")
96+
// store
97+
BUILTIN(__builtin_ppc_store2r, "vUiUs*", "")
98+
BUILTIN(__builtin_ppc_store4r, "vUiUi*", "")
99+
BUILTIN(__builtin_ppc_store8r, "vULLiULLi*", "")
100+
BUILTIN(__builtin_ppc_extract_exp, "Uid", "")
101+
BUILTIN(__builtin_ppc_extract_sig, "ULLid", "")
102+
BUILTIN(__builtin_ppc_mtfsb0, "vUIi", "")
103+
BUILTIN(__builtin_ppc_mtfsb1, "vUIi", "")
104+
BUILTIN(__builtin_ppc_mtfsf, "vUIiUi", "")
105+
BUILTIN(__builtin_ppc_mtfsfi, "vUIiUIi", "")
106+
BUILTIN(__builtin_ppc_insert_exp, "ddULLi", "")
107+
BUILTIN(__builtin_ppc_fmsub, "dddd", "")
108+
BUILTIN(__builtin_ppc_fmsubs, "ffff", "")
109+
BUILTIN(__builtin_ppc_fnmadd, "dddd", "")
110+
BUILTIN(__builtin_ppc_fnmadds, "ffff", "")
111+
BUILTIN(__builtin_ppc_fnmsub, "dddd", "")
112+
BUILTIN(__builtin_ppc_fnmsubs, "ffff", "")
113+
BUILTIN(__builtin_ppc_fre, "dd", "")
114+
BUILTIN(__builtin_ppc_fres, "ff", "")
86115

87116
BUILTIN(__builtin_ppc_get_timebase, "ULLi", "n")
88117

clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
111111
DefaultFatal;
112112
def err_module_prebuilt : Error<
113113
"error in loading module '%0' from prebuilt module path">, DefaultFatal;
114+
def err_module_rebuild_finalized : Error<
115+
"cannot rebuild module '%0' as it is already finalized">, DefaultFatal;
114116
def note_pragma_entered_here : Note<"#pragma entered here">;
115117
def note_decl_hiding_tag_type : Note<
116118
"%1 %0 is hidden by a non-type declaration of %0 here">;

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,9 @@ def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
10851085
// A warning group for warnings about code that clang accepts but gcc doesn't.
10861086
def GccCompat : DiagGroup<"gcc-compat">;
10871087

1088+
// A warning group for warnings about code that may be incompatible on AIX.
1089+
def AIXCompat : DiagGroup<"aix-compat">;
1090+
10881091
// Warnings for Microsoft extensions.
10891092
def MicrosoftCharize : DiagGroup<"microsoft-charize">;
10901093
def MicrosoftDrectveSection : DiagGroup<"microsoft-drectve-section">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,10 @@ def warn_assume_aligned_too_great
32933293
: Warning<"requested alignment must be %0 bytes or smaller; maximum "
32943294
"alignment assumed">,
32953295
InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
3296+
def warn_not_xl_compatible
3297+
: Warning<"requesting an alignment of 16 bytes or greater for struct"
3298+
" members is not binary compatible with AIX XL 16.1 and older">,
3299+
InGroup<AIXCompat>;
32963300
def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
32973301
"%q0 redeclared without %1 attribute: previous %1 ignored">,
32983302
InGroup<MicrosoftInconsistentDllImport>;
@@ -9776,6 +9780,8 @@ def err_argument_not_shifted_byte : Error<
97769780
"argument should be an 8-bit value shifted by a multiple of 8 bits">;
97779781
def err_argument_not_shifted_byte_or_xxff : Error<
97789782
"argument should be an 8-bit value shifted by a multiple of 8 bits, or in the form 0x??FF">;
9783+
def err_argument_not_contiguous_bit_field : Error<
9784+
"argument %0 value should represent a contiguous bit field">;
97799785
def err_rotation_argument_to_cadd
97809786
: Error<"argument should be the value 90 or 270">;
97819787
def err_rotation_argument_to_cmla

clang/include/clang/Basic/DiagnosticSerializationKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def err_module_file_not_module : Error<
6969
"AST file '%0' was not built as a module">, DefaultFatal;
7070
def err_module_file_missing_top_level_submodule : Error<
7171
"module file '%0' is missing its top-level submodule">, DefaultFatal;
72+
def note_module_file_conflict : Note<
73+
"this is generally caused by modules with the same name found in multiple "
74+
"paths">;
7275

7376
def remark_module_import : Remark<
7477
"importing module '%0'%select{| into '%3'}2 from '%1'">,

clang/include/clang/Basic/OpenCLOptions.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,23 @@ static inline bool isOpenCLVersionContainedInMask(const LangOptions &LO,
6767

6868
/// OpenCL supported extensions and optional core features
6969
class OpenCLOptions {
70+
7071
public:
72+
// OpenCL C v1.2 s6.5 - All program scope variables must be declared in the
73+
// __constant address space.
74+
// OpenCL C v2.0 s6.5.1 - Variables defined at program scope and static
75+
// variables inside a function can also be declared in the global
76+
// address space.
77+
// OpenCL C v3.0 s6.7.1 - Variables at program scope or static or extern
78+
// variables inside functions can be declared in global address space if
79+
// the __opencl_c_program_scope_global_variables feature is supported
80+
// C++ for OpenCL inherits rule from OpenCL C v2.0.
81+
bool areProgramScopeVariablesSupported(const LangOptions &Opts) const {
82+
return Opts.OpenCLCPlusPlus || Opts.OpenCLVersion == 200 ||
83+
(Opts.OpenCLVersion == 300 &&
84+
isSupported("__opencl_c_program_scope_global_variables", Opts));
85+
}
86+
7187
struct OpenCLOptionInfo {
7288
// Does this option have pragma.
7389
bool WithPragma = false;

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12919,6 +12919,7 @@ class Sema final {
1291912919
bool SemaBuiltinComplex(CallExpr *TheCall);
1292012920
bool SemaBuiltinVSX(CallExpr *TheCall);
1292112921
bool SemaBuiltinOSLogFormat(CallExpr *TheCall);
12922+
bool SemaValueIsRunOfOnes(CallExpr *TheCall, unsigned ArgNum);
1292212923

1292312924
public:
1292412925
// Used by C++ template instantiation.

clang/include/clang/Serialization/ASTReader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,9 @@ class ASTReader
14011401
llvm::iterator_range<PreprocessingRecord::iterator>
14021402
getModulePreprocessedEntities(ModuleFile &Mod) const;
14031403

1404+
bool canRecoverFromOutOfDate(StringRef ModuleFileName,
1405+
unsigned ClientLoadCapabilities);
1406+
14041407
public:
14051408
class ModuleDeclIterator
14061409
: public llvm::iterator_adaptor_base<

clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,13 +432,17 @@ class PathSensitiveBugReport : public BugReport {
432432
void markInteresting(SymbolRef sym, bugreporter::TrackingKind TKind =
433433
bugreporter::TrackingKind::Thorough);
434434

435+
void markNotInteresting(SymbolRef sym);
436+
435437
/// Marks a region as interesting. Different kinds of interestingness will
436438
/// be processed differently by visitors (e.g. if the tracking kind is
437439
/// condition, will append "will be used as a condition" to the message).
438440
void markInteresting(
439441
const MemRegion *R,
440442
bugreporter::TrackingKind TKind = bugreporter::TrackingKind::Thorough);
441443

444+
void markNotInteresting(const MemRegion *R);
445+
442446
/// Marks a symbolic value as interesting. Different kinds of interestingness
443447
/// will be processed differently by visitors (e.g. if the tracking kind is
444448
/// condition, will append "will be used as a condition" to the message).

clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERHELPERS_H
1414
#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERHELPERS_H
1515

16+
#include "clang/AST/OperationKinds.h"
1617
#include "clang/AST/Stmt.h"
18+
#include "clang/Basic/OperatorKinds.h"
1719
#include "llvm/ADT/Optional.h"
1820
#include <tuple>
1921

@@ -69,6 +71,45 @@ Nullability getNullabilityAnnotation(QualType Type);
6971
/// token for an integer. If we cannot parse the value then None is returned.
7072
llvm::Optional<int> tryExpandAsInteger(StringRef Macro, const Preprocessor &PP);
7173

74+
class OperatorKind {
75+
union {
76+
BinaryOperatorKind Bin;
77+
UnaryOperatorKind Un;
78+
} Op;
79+
bool IsBinary;
80+
81+
public:
82+
explicit OperatorKind(BinaryOperatorKind Bin) : Op{Bin}, IsBinary{true} {}
83+
explicit OperatorKind(UnaryOperatorKind Un) : IsBinary{false} { Op.Un = Un; }
84+
bool IsBinaryOp() const { return IsBinary; }
85+
86+
BinaryOperatorKind GetBinaryOpUnsafe() const {
87+
assert(IsBinary && "cannot get binary operator - we have a unary operator");
88+
return Op.Bin;
89+
}
90+
91+
Optional<BinaryOperatorKind> GetBinaryOp() const {
92+
if (IsBinary)
93+
return Op.Bin;
94+
return {};
95+
}
96+
97+
UnaryOperatorKind GetUnaryOpUnsafe() const {
98+
assert(!IsBinary &&
99+
"cannot get unary operator - we have a binary operator");
100+
return Op.Un;
101+
}
102+
103+
Optional<UnaryOperatorKind> GetUnaryOp() const {
104+
if (!IsBinary)
105+
return Op.Un;
106+
return {};
107+
}
108+
};
109+
110+
OperatorKind operationKindFromOverloadedOperator(OverloadedOperatorKind OOK,
111+
bool IsBinary);
112+
72113
} // namespace ento
73114

74115
} // namespace clang

clang/lib/AST/Expr.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ DeclRefExpr *DeclRefExpr::CreateEmpty(const ASTContext &Context,
490490

491491
void DeclRefExpr::setDecl(ValueDecl *NewD) {
492492
D = NewD;
493+
if (getType()->isUndeducedType())
494+
setType(NewD->getType());
493495
setDependence(computeDependence(this, NewD->getASTContext()));
494496
}
495497

@@ -1777,8 +1779,10 @@ MemberExpr *MemberExpr::CreateEmpty(const ASTContext &Context,
17771779
return new (Mem) MemberExpr(EmptyShell());
17781780
}
17791781

1780-
void MemberExpr::setMemberDecl(ValueDecl *D) {
1781-
MemberDecl = D;
1782+
void MemberExpr::setMemberDecl(ValueDecl *NewD) {
1783+
MemberDecl = NewD;
1784+
if (getType()->isUndeducedType())
1785+
setType(NewD->getType());
17821786
setDependence(computeDependence(this));
17831787
}
17841788

clang/lib/AST/Type.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,9 @@ namespace {
18011801
}
18021802

18031803
// Only these types can contain the desired 'auto' type.
1804+
Type *VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
1805+
return Visit(T->getReplacementType());
1806+
}
18041807

18051808
Type *VisitElaboratedType(const ElaboratedType *T) {
18061809
return Visit(T->getNamedType());

clang/lib/Basic/Targets/PPC.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
8989

9090
static void defineXLCompatMacros(MacroBuilder &Builder) {
9191
Builder.defineMacro("__popcntb", "__builtin_ppc_popcntb");
92+
Builder.defineMacro("__poppar4", "__builtin_ppc_poppar4");
93+
Builder.defineMacro("__poppar8", "__builtin_ppc_poppar8");
9294
Builder.defineMacro("__eieio", "__builtin_ppc_eieio");
9395
Builder.defineMacro("__iospace_eieio", "__builtin_ppc_iospace_eieio");
9496
Builder.defineMacro("__isync", "__builtin_ppc_isync");
@@ -140,6 +142,30 @@ static void defineXLCompatMacros(MacroBuilder &Builder) {
140142
Builder.defineMacro("__maddhd", "__builtin_ppc_maddhd");
141143
Builder.defineMacro("__maddhdu", "__builtin_ppc_maddhdu");
142144
Builder.defineMacro("__maddld", "__builtin_ppc_maddld");
145+
Builder.defineMacro("__rlwnm", "__builtin_ppc_rlwnm");
146+
Builder.defineMacro("__rlwimi", "__builtin_ppc_rlwimi");
147+
Builder.defineMacro("__rldimi", "__builtin_ppc_rldimi");
148+
Builder.defineMacro("__load2r", "__builtin_ppc_load2r");
149+
Builder.defineMacro("__load4r", "__builtin_ppc_load4r");
150+
Builder.defineMacro("__load8r", "__builtin_ppc_load8r");
151+
Builder.defineMacro("__store2r", "__builtin_ppc_store2r");
152+
Builder.defineMacro("__store4r", "__builtin_ppc_store4r");
153+
Builder.defineMacro("__store8r", "__builtin_ppc_store8r");
154+
Builder.defineMacro("__extract_exp", "__builtin_ppc_extract_exp");
155+
Builder.defineMacro("__extract_sig", "__builtin_ppc_extract_sig");
156+
Builder.defineMacro("__mtfsb0", "__builtin_ppc_mtfsb0");
157+
Builder.defineMacro("__mtfsb1", "__builtin_ppc_mtfsb1");
158+
Builder.defineMacro("__mtfsf", "__builtin_ppc_mtfsf");
159+
Builder.defineMacro("__mtfsfi", "__builtin_ppc_mtfsfi");
160+
Builder.defineMacro("__insert_exp", "__builtin_ppc_insert_exp");
161+
Builder.defineMacro("__fmsub", "__builtin_ppc_fmsub");
162+
Builder.defineMacro("__fmsubs", "__builtin_ppc_fmsubs");
163+
Builder.defineMacro("__fnmadd", "__builtin_ppc_fnmadd");
164+
Builder.defineMacro("__fnmadds", "__builtin_ppc_fnmadds");
165+
Builder.defineMacro("__fnmsub", "__builtin_ppc_fnmsub");
166+
Builder.defineMacro("__fnmsubs", "__builtin_ppc_fnmsubs");
167+
Builder.defineMacro("__fre", "__builtin_ppc_fre");
168+
Builder.defineMacro("__fres", "__builtin_ppc_fres");
143169
}
144170

145171
/// PPCTargetInfo::getTargetDefines - Return a set of the PowerPC-specific

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,6 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
12931293
// Only enable CGProfilePass when using integrated assembler, since
12941294
// non-integrated assemblers don't recognize .cgprofile section.
12951295
PTO.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
1296-
PTO.Coroutines = LangOpts.Coroutines;
12971296

12981297
LoopAnalysisManager LAM;
12991298
FunctionAnalysisManager FAM;

0 commit comments

Comments
 (0)