Skip to content

Commit f8dda28

Browse files
committed
Merge from 'main' to 'sycl-web' (#131)
CONFLICT (content): Merge conflict in clang/lib/CodeGen/CGLoopInfo.cpp
2 parents e2b3b78 + 38d18d9 commit f8dda28

File tree

658 files changed

+13155
-8693
lines changed

Some content is hidden

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

658 files changed

+13155
-8693
lines changed

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,15 +620,17 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
620620
{"documentSymbolProvider", true},
621621
{"workspaceSymbolProvider", true},
622622
{"referencesProvider", true},
623-
{"astProvider", true},
623+
{"astProvider", true}, // clangd extension
624624
{"executeCommandProvider",
625625
llvm::json::Object{
626626
{"commands",
627627
{ExecuteCommandParams::CLANGD_APPLY_FIX_COMMAND,
628628
ExecuteCommandParams::CLANGD_APPLY_TWEAK}},
629629
}},
630630
{"typeHierarchyProvider", true},
631-
{"memoryUsageProvider", true}, // clangd extension.
631+
{"memoryUsageProvider", true}, // clangd extension
632+
{"compilationDatabase", // clangd extension
633+
llvm::json::Object{{"automaticReload", true}}},
632634
{"callHierarchyProvider", true},
633635
}}}};
634636
if (Opts.Encoding)

clang-tools-extra/clangd/test/initialize-params.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
# CHECK-NEXT: "astProvider": true,
99
# CHECK-NEXT: "callHierarchyProvider": true,
1010
# CHECK-NEXT: "codeActionProvider": true,
11+
# CHECK-NEXT: "compilationDatabase": {
12+
# CHECK-NEXT: "automaticReload": true
13+
# CHECK-NEXT: },
1114
# CHECK-NEXT: "completionProvider": {
1215
# CHECK-NEXT: "allCommitCharacters": [
1316
# CHECK-NEXT: " ",

clang/docs/LanguageExtensions.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3131,8 +3131,18 @@ manually enable vectorization or interleaving.
31313131
...
31323132
}
31333133
3134-
The vector width is specified by ``vectorize_width(_value_)`` and the interleave
3135-
count is specified by ``interleave_count(_value_)``, where
3134+
The vector width is specified by
3135+
``vectorize_width(_value_[, fixed|scalable])``, where _value_ is a positive
3136+
integer and the type of vectorization can be specified with an optional
3137+
second parameter. The default for the second parameter is 'fixed' and
3138+
refers to fixed width vectorization, whereas 'scalable' indicates the
3139+
compiler should use scalable vectors instead. Another use of vectorize_width
3140+
is ``vectorize_width(fixed|scalable)`` where the user can hint at the type
3141+
of vectorization to use without specifying the exact width. In both variants
3142+
of the pragma the vectorizer may decide to fall back on fixed width
3143+
vectorization if the target does not support scalable vectors.
3144+
3145+
The interleave count is specified by ``interleave_count(_value_)``, where
31363146
_value_ is a positive integer. This is useful for specifying the optimal
31373147
width/count of the set of target architectures supported by your application.
31383148

clang/docs/OpenMPSupport.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ implementation.
193193
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
194194
| device extension | implicitly map 'this' (this[:1]) | :good:`done` | D55982 |
195195
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
196-
| device extension | allow access to the reference count (omp_target_is_present) | :part:`worked on` | |
196+
| device extension | allow access to the reference count (omp_target_is_present) | :part:`done` | |
197197
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
198198
| device extension | requires directive | :part:`partial` | |
199199
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
@@ -215,7 +215,7 @@ implementation.
215215
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
216216
| device extension | support close modifier on map clause | :good:`done` | D55719,D55892 |
217217
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
218-
| device extension | teams construct on the host device | :part:`worked on` | Clang part is done, r371553. |
218+
| device extension | teams construct on the host device | :part:`done` | r371553 |
219219
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
220220
| device extension | support non-contiguous array sections for target update | :good:`done` | |
221221
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+

clang/include/clang/AST/DeclOpenMP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class OMPThreadPrivateDecl final : public OMPDeclarativeDirective<Decl> {
163163
/// 'float':
164164
///
165165
/// \code
166-
/// #pragma omp declare reduction (foo : int,float : omp_out += omp_in) \
166+
/// #pragma omp declare reduction (foo : int,float : omp_out += omp_in)
167167
/// initializer (omp_priv = 0)
168168
/// \endcode
169169
///

clang/include/clang/AST/TypeLoc.h

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,30 +1749,79 @@ class DependentAddressSpaceTypeLoc
17491749

17501750
// FIXME: size expression and attribute locations (or keyword if we
17511751
// ever fully support altivec syntax).
1752-
class VectorTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
1753-
VectorTypeLoc,
1754-
VectorType> {
1752+
struct VectorTypeLocInfo {
1753+
SourceLocation NameLoc;
1754+
};
1755+
1756+
class VectorTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, VectorTypeLoc,
1757+
VectorType, VectorTypeLocInfo> {
1758+
public:
1759+
SourceLocation getNameLoc() const { return this->getLocalData()->NameLoc; }
1760+
1761+
void setNameLoc(SourceLocation Loc) { this->getLocalData()->NameLoc = Loc; }
1762+
1763+
SourceRange getLocalSourceRange() const {
1764+
return SourceRange(getNameLoc(), getNameLoc());
1765+
}
1766+
1767+
void initializeLocal(ASTContext &Context, SourceLocation Loc) {
1768+
setNameLoc(Loc);
1769+
}
1770+
1771+
TypeLoc getElementLoc() const { return getInnerTypeLoc(); }
1772+
1773+
QualType getInnerType() const { return this->getTypePtr()->getElementType(); }
17551774
};
17561775

17571776
// FIXME: size expression and attribute locations (or keyword if we
17581777
// ever fully support altivec syntax).
17591778
class DependentVectorTypeLoc
1760-
: public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
1761-
DependentVectorTypeLoc,
1762-
DependentVectorType> {};
1779+
: public ConcreteTypeLoc<UnqualTypeLoc, DependentVectorTypeLoc,
1780+
DependentVectorType, VectorTypeLocInfo> {
1781+
public:
1782+
SourceLocation getNameLoc() const { return this->getLocalData()->NameLoc; }
17631783

1764-
// FIXME: size expression and attribute locations.
1765-
class ExtVectorTypeLoc : public InheritingConcreteTypeLoc<VectorTypeLoc,
1766-
ExtVectorTypeLoc,
1767-
ExtVectorType> {
1784+
void setNameLoc(SourceLocation Loc) { this->getLocalData()->NameLoc = Loc; }
1785+
1786+
SourceRange getLocalSourceRange() const {
1787+
return SourceRange(getNameLoc(), getNameLoc());
1788+
}
1789+
1790+
void initializeLocal(ASTContext &Context, SourceLocation Loc) {
1791+
setNameLoc(Loc);
1792+
}
1793+
1794+
TypeLoc getElementLoc() const { return getInnerTypeLoc(); }
1795+
1796+
QualType getInnerType() const { return this->getTypePtr()->getElementType(); }
17681797
};
17691798

1799+
// FIXME: size expression and attribute locations.
1800+
class ExtVectorTypeLoc
1801+
: public InheritingConcreteTypeLoc<VectorTypeLoc, ExtVectorTypeLoc,
1802+
ExtVectorType> {};
1803+
17701804
// FIXME: attribute locations.
17711805
// For some reason, this isn't a subtype of VectorType.
1772-
class DependentSizedExtVectorTypeLoc :
1773-
public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
1774-
DependentSizedExtVectorTypeLoc,
1775-
DependentSizedExtVectorType> {
1806+
class DependentSizedExtVectorTypeLoc
1807+
: public ConcreteTypeLoc<UnqualTypeLoc, DependentSizedExtVectorTypeLoc,
1808+
DependentSizedExtVectorType, VectorTypeLocInfo> {
1809+
public:
1810+
SourceLocation getNameLoc() const { return this->getLocalData()->NameLoc; }
1811+
1812+
void setNameLoc(SourceLocation Loc) { this->getLocalData()->NameLoc = Loc; }
1813+
1814+
SourceRange getLocalSourceRange() const {
1815+
return SourceRange(getNameLoc(), getNameLoc());
1816+
}
1817+
1818+
void initializeLocal(ASTContext &Context, SourceLocation Loc) {
1819+
setNameLoc(Loc);
1820+
}
1821+
1822+
TypeLoc getElementLoc() const { return getInnerTypeLoc(); }
1823+
1824+
QualType getInnerType() const { return this->getTypePtr()->getElementType(); }
17761825
};
17771826

17781827
struct MatrixTypeLocInfo {

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3985,8 +3985,10 @@ def LoopHint : Attr {
39853985
"PipelineDisabled", "PipelineInitiationInterval", "Distribute",
39863986
"VectorizePredicate"]>,
39873987
EnumArgument<"State", "LoopHintState",
3988-
["enable", "disable", "numeric", "assume_safety", "full"],
3989-
["Enable", "Disable", "Numeric", "AssumeSafety", "Full"]>,
3988+
["enable", "disable", "numeric", "fixed_width",
3989+
"scalable_width", "assume_safety", "full"],
3990+
["Enable", "Disable", "Numeric", "FixedWidth",
3991+
"ScalableWidth", "AssumeSafety", "Full"]>,
39903992
ExprArgument<"Value">];
39913993

39923994
let AdditionalMembers = [{

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,12 @@ def err_pragma_loop_invalid_option : Error<
13961396
"%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, "
13971397
"vectorize_width, interleave, interleave_count, unroll, unroll_count, "
13981398
"pipeline, pipeline_initiation_interval, vectorize_predicate, or distribute">;
1399+
def err_pragma_loop_invalid_vectorize_option : Error<
1400+
"vectorize_width loop hint malformed; use vectorize_width(X, fixed) or "
1401+
"vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">;
1402+
def note_pragma_loop_invalid_vectorize_option : Note<
1403+
"vectorize_width loop hint malformed; use vectorize_width(X, fixed) or "
1404+
"vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">;
13991405

14001406
def err_pragma_fp_invalid_option : Error<
14011407
"%select{invalid|missing}0 option%select{ %1|}0; expected 'contract', 'reassociate' or 'exceptions'">;

clang/include/clang/Tooling/CompilationDatabase.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ namespace tooling {
4343
/// Specifies the working directory and command of a compilation.
4444
struct CompileCommand {
4545
CompileCommand() = default;
46-
CompileCommand(Twine Directory, Twine Filename,
47-
std::vector<std::string> CommandLine, Twine Output)
46+
CompileCommand(const Twine &Directory, const Twine &Filename,
47+
std::vector<std::string> CommandLine, const Twine &Output)
4848
: Directory(Directory.str()), Filename(Filename.str()),
49-
CommandLine(std::move(CommandLine)), Output(Output.str()){}
49+
CommandLine(std::move(CommandLine)), Output(Output.str()) {}
5050

5151
/// The working directory the command was executed from.
5252
std::string Directory;
@@ -180,9 +180,9 @@ class FixedCompilationDatabase : public CompilationDatabase {
180180
/// \param Argv Points to the command line arguments.
181181
/// \param ErrorMsg Contains error text if the function returns null pointer.
182182
/// \param Directory The base directory used in the FixedCompilationDatabase.
183-
static std::unique_ptr<FixedCompilationDatabase> loadFromCommandLine(
184-
int &Argc, const char *const *Argv, std::string &ErrorMsg,
185-
Twine Directory = ".");
183+
static std::unique_ptr<FixedCompilationDatabase>
184+
loadFromCommandLine(int &Argc, const char *const *Argv, std::string &ErrorMsg,
185+
const Twine &Directory = ".");
186186

187187
/// Reads flags from the given file, one-per-line.
188188
/// Returns nullptr and sets ErrorMessage if we can't read the file.
@@ -196,7 +196,8 @@ class FixedCompilationDatabase : public CompilationDatabase {
196196

197197
/// Constructs a compilation data base from a specified directory
198198
/// and command line.
199-
FixedCompilationDatabase(Twine Directory, ArrayRef<std::string> CommandLine);
199+
FixedCompilationDatabase(const Twine &Directory,
200+
ArrayRef<std::string> CommandLine);
200201

201202
/// Returns the given compile command.
202203
///

clang/lib/AST/AttrImpl.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ std::string LoopHintAttr::getValueString(const PrintingPolicy &Policy) const {
4242
OS << "(";
4343
if (state == Numeric)
4444
value->printPretty(OS, nullptr, Policy);
45-
else if (state == Enable)
45+
else if (state == FixedWidth || state == ScalableWidth) {
46+
if (value) {
47+
value->printPretty(OS, nullptr, Policy);
48+
if (state == ScalableWidth)
49+
OS << ", scalable";
50+
} else if (state == ScalableWidth)
51+
OS << "scalable";
52+
else
53+
OS << "fixed";
54+
} else if (state == Enable)
4655
OS << "enable";
4756
else if (state == Full)
4857
OS << "full";

clang/lib/AST/ExprConstant.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11413,9 +11413,9 @@ static bool tryEvaluateBuiltinObjectSize(const Expr *E, unsigned Type,
1141311413
return false;
1141411414
}
1141511415

11416-
// If we point to before the start of the object, there are no accessible
11417-
// bytes.
11418-
if (LVal.getLValueOffset().isNegative()) {
11416+
// If we point outside of the object, there are no accessible bytes.
11417+
if (LVal.getLValueOffset().isNegative() ||
11418+
((Type & 1) && !LVal.Designator.isValidSubobject())) {
1141911419
Size = 0;
1142011420
return true;
1142111421
}

clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include "clang/Analysis/PathDiagnostic.h"
1414
#include "clang/Analysis/PathDiagnosticConsumers.h"
1515
#include "clang/Basic/SourceManager.h"
16-
#include "clang/CrossTU/CrossTranslationUnit.h"
1716
#include "clang/Lex/Preprocessor.h"
17+
#include "llvm/Support/Path.h"
1818

1919
using namespace clang;
2020
using namespace ento;

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13961,8 +13961,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
1396113961
// Lowering vector comparisons to fcmp instructions, while
1396213962
// ignoring signalling behaviour requested
1396313963
// ignoring rounding mode requested
13964-
// This is is only possible as long as FENV_ACCESS is not implemented.
13965-
// See also: https://reviews.llvm.org/D45616
13964+
// This is only possible if fp-model is not strict and FENV_ACCESS is off.
1396613965

1396713966
// The third argument is the comparison condition, and integer in the
1396813967
// range [0, 31]

0 commit comments

Comments
 (0)