Skip to content

Commit 49d795f

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents fd59a98 + ddba036 commit 49d795f

File tree

88 files changed

+8285
-3691
lines changed

Some content is hidden

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

88 files changed

+8285
-3691
lines changed

clang/include/clang/Basic/BuiltinsBase.td

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ class Builtin {
8888
// On some platforms, some functions are actually macros. In that case we need
8989
// to #undef them.
9090
bit RequiresUndef = 0;
91+
// Enables builtins to generate `long long` outside of OpenCL and `long` inside.
92+
bit EnableOpenCLLong = 0;
9193
}
9294

9395
class CustomEntry {
9496
string Entry;
9597
}
9698

9799
class AtomicBuiltin : Builtin;
98-
class TargetBuiltin : Builtin {
99-
string Features = "";
100-
}
101100

102101
class LibBuiltin<string header, string languages = "ALL_LANGUAGES"> : Builtin {
103102
string Header = header;
@@ -122,6 +121,14 @@ class OCL_DSELangBuiltin : LangBuiltin<"OCL_DSE">;
122121
class OCL_GASLangBuiltin : LangBuiltin<"OCL_GAS">;
123122
class OCLLangBuiltin : LangBuiltin<"ALL_OCL_LANGUAGES">;
124123

124+
class TargetBuiltin : Builtin {
125+
string Features = "";
126+
}
127+
class TargetLibBuiltin : TargetBuiltin {
128+
string Header;
129+
string Languages = "ALL_LANGUAGES";
130+
}
131+
125132
class Template<list<string> substitutions,
126133
list<string> affixes,
127134
bit as_prefix = 0> {

clang/include/clang/Basic/BuiltinsX86.def

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

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 5378 additions & 4 deletions
Large diffs are not rendered by default.
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,11 @@ namespace clang {
124124
enum {
125125
LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
126126
#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
127-
#include "clang/Basic/BuiltinsX86.def"
128-
#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
129127
#include "clang/Basic/BuiltinsX86.inc"
130128
FirstX86_64Builtin,
131129
LastX86CommonBuiltin = FirstX86_64Builtin - 1,
132130
#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
133-
#include "clang/Basic/BuiltinsX86_64.def"
131+
#include "clang/Basic/BuiltinsX86_64.inc"
134132
LastTSBuiltin
135133
};
136134
}

clang/lib/Basic/Targets/X86.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ namespace clang {
2424
namespace targets {
2525

2626
static constexpr Builtin::Info BuiltinInfoX86[] = {
27-
#define BUILTIN(ID, TYPE, ATTRS) \
28-
{#ID, TYPE, ATTRS, nullptr, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
29-
#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \
30-
{#ID, TYPE, ATTRS, FEATURE, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
31-
#define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \
32-
{#ID, TYPE, ATTRS, FEATURE, HeaderDesc::HEADER, LANGS},
33-
#include "clang/Basic/BuiltinsX86.def"
34-
3527
#define BUILTIN(ID, TYPE, ATTRS) \
3628
{#ID, TYPE, ATTRS, nullptr, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
3729
#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \
@@ -46,7 +38,7 @@ static constexpr Builtin::Info BuiltinInfoX86[] = {
4638
{#ID, TYPE, ATTRS, FEATURE, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
4739
#define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \
4840
{#ID, TYPE, ATTRS, FEATURE, HeaderDesc::HEADER, LANGS},
49-
#include "clang/Basic/BuiltinsX86_64.def"
41+
#include "clang/Basic/BuiltinsX86_64.inc"
5042
};
5143

5244
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)