Skip to content

Commit a2ba00a

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-update-iv-exit-users
2 parents 4b3ff63 + df4a615 commit a2ba00a

File tree

116 files changed

+2572
-953
lines changed

Some content is hidden

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

116 files changed

+2572
-953
lines changed

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
include "clang/Basic/BuiltinsBase.td"
14-
15-
class X86Builtin<string prototype> : TargetBuiltin {
16-
let Spellings = ["__builtin_ia32_" # NAME];
17-
let Prototype = prototype;
18-
let EnableOpenCLLong = 1;
19-
}
20-
21-
class X86NoPrefixBuiltin<string prototype> : TargetBuiltin {
22-
let Spellings = [NAME];
23-
let Prototype = prototype;
24-
}
25-
26-
class X86LibBuiltin<string prototype> : TargetLibBuiltin {
27-
let Spellings = [NAME];
28-
let Prototype = prototype;
29-
}
13+
include "clang/Basic/BuiltinsX86Base.td"
3014

3115
def rdpmc : X86Builtin<"unsigned long long int(int)">;
3216
def rdtsc : X86Builtin<"unsigned long long int()">;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===--- BuiltinsX86Base.td - X86 Builtin function classes ------*- C++ -*-===//
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+
// This file defines the X86-specific builtin function classes.
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
include "clang/Basic/BuiltinsBase.td"
14+
15+
class X86Builtin<string prototype> : TargetBuiltin {
16+
let Spellings = ["__builtin_ia32_" # NAME];
17+
let Prototype = prototype;
18+
let EnableOpenCLLong = 1;
19+
}
20+
21+
class X86NoPrefixBuiltin<string prototype> : TargetBuiltin {
22+
let Spellings = [NAME];
23+
let Prototype = prototype;
24+
}
25+
26+
class X86LibBuiltin<string prototype> : TargetLibBuiltin {
27+
let Spellings = [NAME];
28+
let Prototype = prototype;
29+
}

clang/include/clang/Basic/BuiltinsX86_64.def

Lines changed: 0 additions & 253 deletions
This file was deleted.

clang/include/clang/Basic/BuiltinsX86_64.td

Lines changed: 485 additions & 0 deletions
Large diffs are not rendered by default.

clang/include/clang/Basic/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ clang_tablegen(BuiltinsX86.inc -gen-clang-builtins
6464
SOURCE BuiltinsX86.td
6565
TARGET ClangBuiltinsX86)
6666

67+
clang_tablegen(BuiltinsX86_64.inc -gen-clang-builtins
68+
SOURCE BuiltinsX86_64.td
69+
TARGET ClangBuiltinsX86_64)
70+
6771
# ARM NEON and MVE
6872
clang_tablegen(arm_neon.inc -gen-arm-neon-sema
6973
SOURCE arm_neon.td

clang/include/clang/Basic/TargetBuiltins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ namespace clang {
128128
FirstX86_64Builtin,
129129
LastX86CommonBuiltin = FirstX86_64Builtin - 1,
130130
#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
131-
#include "clang/Basic/BuiltinsX86_64.def"
131+
#include "clang/Basic/BuiltinsX86_64.inc"
132132
LastTSBuiltin
133133
};
134134
}

clang/include/clang/Sema/Sema.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13055,6 +13055,7 @@ class Sema final : public SemaBase {
1305513055
///
1305613056
/// \param SkipForSpecialization when specified, any template specializations
1305713057
/// in a traversal would be ignored.
13058+
///
1305813059
/// \param ForDefaultArgumentSubstitution indicates we should continue looking
1305913060
/// when encountering a specialized member function template, rather than
1306013061
/// returning immediately.
@@ -13066,6 +13067,17 @@ class Sema final : public SemaBase {
1306613067
bool SkipForSpecialization = false,
1306713068
bool ForDefaultArgumentSubstitution = false);
1306813069

13070+
/// Apart from storing the result to \p Result, this behaves the same as
13071+
/// another overload.
13072+
void getTemplateInstantiationArgs(
13073+
MultiLevelTemplateArgumentList &Result, const NamedDecl *D,
13074+
const DeclContext *DC = nullptr, bool Final = false,
13075+
std::optional<ArrayRef<TemplateArgument>> Innermost = std::nullopt,
13076+
bool RelativeToPrimary = false, const FunctionDecl *Pattern = nullptr,
13077+
bool ForConstraintInstantiation = false,
13078+
bool SkipForSpecialization = false,
13079+
bool ForDefaultArgumentSubstitution = false);
13080+
1306913081
/// RAII object to handle the state changes required to synthesize
1307013082
/// a function body.
1307113083
class SynthesizedFunctionScope {
@@ -13335,7 +13347,7 @@ class Sema final : public SemaBase {
1333513347
ExprResult
1333613348
SubstConstraintExpr(Expr *E,
1333713349
const MultiLevelTemplateArgumentList &TemplateArgs);
13338-
// Unlike the above, this does not evaluates constraints.
13350+
// Unlike the above, this does not evaluate constraints.
1333913351
ExprResult SubstConstraintExprWithoutSatisfaction(
1334013352
Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs);
1334113353

@@ -14456,10 +14468,10 @@ class Sema final : public SemaBase {
1445614468
const MultiLevelTemplateArgumentList &TemplateArgs,
1445714469
SourceRange TemplateIDRange);
1445814470

14459-
bool CheckInstantiatedFunctionTemplateConstraints(
14460-
SourceLocation PointOfInstantiation, FunctionDecl *Decl,
14461-
ArrayRef<TemplateArgument> TemplateArgs,
14462-
ConstraintSatisfaction &Satisfaction);
14471+
bool CheckFunctionTemplateConstraints(SourceLocation PointOfInstantiation,
14472+
FunctionDecl *Decl,
14473+
ArrayRef<TemplateArgument> TemplateArgs,
14474+
ConstraintSatisfaction &Satisfaction);
1446314475

1446414476
/// \brief Emit diagnostics explaining why a constraint expression was deemed
1446514477
/// unsatisfied.

clang/include/clang/Sema/Template.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,12 @@ enum class TemplateSubstitutionKind : char {
522522
llvm::PointerUnion<Decl *, DeclArgumentPack *> *
523523
findInstantiationOf(const Decl *D);
524524

525+
/// Similar to \p findInstantiationOf(), but it wouldn't assert if the
526+
/// instantiation was not found within the current instantiation scope. This
527+
/// is helpful for on-demand declaration instantiation.
528+
llvm::PointerUnion<Decl *, DeclArgumentPack *> *
529+
findInstantiationUnsafe(const Decl *D);
530+
525531
void InstantiatedLocal(const Decl *D, Decl *Inst);
526532
void InstantiatedLocalPackArg(const Decl *D, VarDecl *Inst);
527533
void MakeInstantiatedLocalArgPack(const Decl *D);

clang/lib/Basic/Targets/X86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static constexpr Builtin::Info BuiltinInfoX86[] = {
3838
{#ID, TYPE, ATTRS, FEATURE, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
3939
#define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \
4040
{#ID, TYPE, ATTRS, FEATURE, HeaderDesc::HEADER, LANGS},
41-
#include "clang/Basic/BuiltinsX86_64.def"
41+
#include "clang/Basic/BuiltinsX86_64.inc"
4242
};
4343

4444
static const char *const GCCRegNames[] = {

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<> &B,
395395
return buildVectorInput(B, GroupThreadIDIntrinsic, Ty);
396396
}
397397
if (D.hasAttr<HLSLSV_GroupIDAttr>()) {
398-
llvm::Function *GroupIDIntrinsic = CGM.getIntrinsic(Intrinsic::dx_group_id);
398+
llvm::Function *GroupIDIntrinsic = CGM.getIntrinsic(getGroupIdIntrinsic());
399399
return buildVectorInput(B, GroupIDIntrinsic, Ty);
400400
}
401401
assert(false && "Unhandled parameter attribute");

0 commit comments

Comments
 (0)