Skip to content

Commit 2c74854

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:139688a699f6db784bd559b147334f1d51314f9c into amd-gfx:cf8fb1be1ea5
Local branch amd-gfx cf8fb1b Merged main:be6aed90c70b7ef718c6c9217158933c8dd57372 into amd-gfx:a2173ce377e5 Remote branch main 139688a [SPIRV] Add atan2 function lowering (p2) (llvm#110037)
2 parents cf8fb1b + 139688a commit 2c74854

File tree

61 files changed

+1106
-369
lines changed

Some content is hidden

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

61 files changed

+1106
-369
lines changed

clang/include/clang/Basic/Builtins.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4703,12 +4703,6 @@ def HLSLClamp : LangBuiltin<"HLSL_LANG"> {
47034703
let Prototype = "void(...)";
47044704
}
47054705

4706-
def HLSLCreateHandle : LangBuiltin<"HLSL_LANG"> {
4707-
let Spellings = ["__builtin_hlsl_create_handle"];
4708-
let Attributes = [NoThrow, Const];
4709-
let Prototype = "void*(unsigned char)";
4710-
}
4711-
47124706
def HLSLDotProduct : LangBuiltin<"HLSL_LANG"> {
47134707
let Spellings = ["__builtin_hlsl_dot"];
47144708
let Attributes = [NoThrow, Const];

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12388,6 +12388,7 @@ def err_hlsl_packoffset_alignment_mismatch : Error<"packoffset at 'y' not match
1238812388
def err_hlsl_pointers_unsupported : Error<
1238912389
"%select{pointers|references}0 are unsupported in HLSL">;
1239012390
def err_hlsl_missing_resource_class : Error<"HLSL resource needs to have [[hlsl::resource_class()]] attribute">;
12391+
def err_hlsl_attribute_needs_intangible_type: Error<"attribute %0 can be used only on HLSL intangible type %1">;
1239112392

1239212393
def err_hlsl_operator_unsupported : Error<
1239312394
"the '%select{&|*|->}0' operator is unsupported in HLSL">;

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class SemaHLSL : public SemaBase {
7070
void handleShaderAttr(Decl *D, const ParsedAttr &AL);
7171
void handleResourceBindingAttr(Decl *D, const ParsedAttr &AL);
7272
void handleParamModifierAttr(Decl *D, const ParsedAttr &AL);
73-
bool handleResourceTypeAttr(const ParsedAttr &AL);
73+
bool handleResourceTypeAttr(QualType T, const ParsedAttr &AL);
7474

7575
bool CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
7676
QualType ProcessResourceTypeAttributes(QualType Wrapped);

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -193,36 +193,8 @@ struct BuiltinTypeDeclBuilder {
193193
ExplicitSpecifier(), false, true, false,
194194
ConstexprSpecKind::Unspecified);
195195

196-
DeclRefExpr *Fn =
197-
lookupBuiltinFunction(AST, S, "__builtin_hlsl_create_handle");
198-
Expr *RCExpr = emitResourceClassExpr(AST, RC);
199-
Expr *Call = CallExpr::Create(AST, Fn, {RCExpr}, AST.VoidPtrTy, VK_PRValue,
200-
SourceLocation(), FPOptionsOverride());
201-
202-
CXXThisExpr *This = CXXThisExpr::Create(
203-
AST, SourceLocation(), Constructor->getFunctionObjectParameterType(),
204-
true);
205-
Expr *Handle = MemberExpr::CreateImplicit(AST, This, false, Fields["h"],
206-
Fields["h"]->getType(), VK_LValue,
207-
OK_Ordinary);
208-
209-
// If the handle isn't a void pointer, cast the builtin result to the
210-
// correct type.
211-
if (Handle->getType().getCanonicalType() != AST.VoidPtrTy) {
212-
Call = CXXStaticCastExpr::Create(
213-
AST, Handle->getType(), VK_PRValue, CK_Dependent, Call, nullptr,
214-
AST.getTrivialTypeSourceInfo(Handle->getType(), SourceLocation()),
215-
FPOptionsOverride(), SourceLocation(), SourceLocation(),
216-
SourceRange());
217-
}
218-
219-
BinaryOperator *Assign = BinaryOperator::Create(
220-
AST, Handle, Call, BO_Assign, Handle->getType(), VK_LValue, OK_Ordinary,
221-
SourceLocation(), FPOptionsOverride());
222-
223-
Constructor->setBody(
224-
CompoundStmt::Create(AST, {Assign}, FPOptionsOverride(),
225-
SourceLocation(), SourceLocation()));
196+
Constructor->setBody(CompoundStmt::Create(
197+
AST, {}, FPOptionsOverride(), SourceLocation(), SourceLocation()));
226198
Constructor->setAccess(AccessSpecifier::AS_public);
227199
Record->addDecl(Constructor);
228200
return *this;

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,13 +693,19 @@ bool clang::CreateHLSLAttributedResourceType(
693693
// HLSL resource. The attributes are collected in HLSLResourcesTypeAttrs and at
694694
// the end of the declaration they are applied to the declaration type by
695695
// wrapping it in HLSLAttributedResourceType.
696-
bool SemaHLSL::handleResourceTypeAttr(const ParsedAttr &AL) {
697-
Attr *A = nullptr;
696+
bool SemaHLSL::handleResourceTypeAttr(QualType T, const ParsedAttr &AL) {
697+
// only allow resource type attributes on intangible types
698+
if (!T->isHLSLResourceType()) {
699+
Diag(AL.getLoc(), diag::err_hlsl_attribute_needs_intangible_type)
700+
<< AL << getASTContext().HLSLResourceTy;
701+
return false;
702+
}
698703

699704
// validate number of arguments
700705
if (!AL.checkExactlyNumArgs(SemaRef, AL.getMinArgs()))
701706
return false;
702707

708+
Attr *A = nullptr;
703709
switch (AL.getKind()) {
704710
case ParsedAttr::AT_HLSLResourceClass: {
705711
if (!AL.isArgIdent(0)) {

clang/lib/Sema/SemaType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8860,7 +8860,7 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type,
88608860
// decl-specifier-seq; do not collect attributes on declarations or those
88618861
// that get to slide after declaration name.
88628862
if (TAL == TAL_DeclSpec &&
8863-
state.getSema().HLSL().handleResourceTypeAttr(attr))
8863+
state.getSema().HLSL().handleResourceTypeAttr(type, attr))
88648864
attr.setUsedAsTypeAttr();
88658865
break;
88668866
}

clang/test/AST/HLSL/RWBuffer-AST.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ RWBuffer<float> Buffer;
6666
// CHECK: TemplateArgument type 'float'
6767
// CHECK-NEXT: BuiltinType 0x{{[0-9A-Fa-f]+}} 'float'
6868
// CHECK-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
69-
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit referenced h 'float *
69+
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h 'float *
7070
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
7171
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(float)]]
7272
// CHECK-SAME: ':'float *'

clang/test/AST/HLSL/StructuredBuffer-AST.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ StructuredBuffer<float> Buffer;
7070
// CHECK: TemplateArgument type 'float'
7171
// CHECK-NEXT: BuiltinType 0x{{[0-9A-Fa-f]+}} 'float'
7272
// CHECK-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
73-
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit referenced h 'float *
73+
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h 'float *
7474
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
7575
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
7676
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(float)]]

clang/test/CodeGenHLSL/builtins/RWBuffer-constructor.hlsl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
22
// RUN: %clang_cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=CHECK-SPIRV
33

4+
// XFAIL: *
5+
// This expectedly fails because create.handle is no longer called
6+
// from RWBuffer constructor and the replacement has not been
7+
// implemented yet. This test should be updated to expect
8+
// dx.create.handleFromBinding as part of issue #105076.
9+
410
RWBuffer<float> Buf;
511

612
// CHECK: define linkonce_odr noundef ptr @"??0?$RWBuffer@M@hlsl@@QAA@XZ"
@@ -10,4 +16,4 @@ RWBuffer<float> Buf;
1016
// CHECK: store ptr %[[HandleRes]], ptr %h, align 4
1117

1218
// CHECK-SPIRV: %[[HandleRes:[0-9]+]] = call ptr @llvm.spv.create.handle(i8 1)
13-
// CHECK-SPIRV: store ptr %[[HandleRes]], ptr %h, align 8
19+
// CHECK-SPIRV: store ptr %[[HandleRes]], ptr %h, align 8

clang/test/CodeGenHLSL/builtins/StructuredBuffer-constructor.hlsl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
12
// RUN: %clang_cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=CHECK-SPIRV
23

4+
// XFAIL: *
5+
// This expectedly fails because create.handle is no longer invoked
6+
// from StructuredBuffer constructor and the replacement has not been
7+
// implemented yet. This test should be updated to expect
8+
// dx.create.handleFromBinding as part of issue #105076.
9+
310
StructuredBuffer<float> Buf;
411

512
// CHECK: define linkonce_odr noundef ptr @"??0?$StructuredBuffer@M@hlsl@@QAA@XZ"

clang/test/CodeGenHLSL/builtins/create_handle.hlsl

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

clang/test/ParserHLSL/hlsl_contained_type_attr_error.hlsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(float)]]
2222

2323
// expected-warning@+1{{attribute 'contained_type' is already applied with different arguments}}
2424
__hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(float)]] [[hlsl::contained_type(int)]] h8;
25+
26+
// expected-error@+2{{attribute 'resource_class' can be used only on HLSL intangible type '__hlsl_resource_t'}}
27+
// expected-error@+1{{attribute 'contained_type' can be used only on HLSL intangible type '__hlsl_resource_t'}}
28+
float [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(float)]] res5;

clang/test/ParserHLSL/hlsl_is_rov_attr_error.hlsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::is_rov(gibberish)]] res3
1414

1515
// expected-warning@+1{{attribute 'is_rov' is already applied}}
1616
__hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::is_rov]] [[hlsl::is_rov]] res4;
17+
18+
// expected-error@+2{{attribute 'resource_class' can be used only on HLSL intangible type '__hlsl_resource_t'}}
19+
// expected-error@+1{{attribute 'is_rov' can be used only on HLSL intangible type '__hlsl_resource_t'}}
20+
float [[hlsl::resource_class(UAV)]] [[hlsl::is_rov]] res5;

clang/test/ParserHLSL/hlsl_raw_buffer_attr_error.hlsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::raw_buffer(gibberish)]]
1111

1212
// expected-warning@+1{{attribute 'raw_buffer' is already applied}}
1313
__hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::raw_buffer]] [[hlsl::raw_buffer]] res4;
14+
15+
// expected-error@+2{{attribute 'resource_class' can be used only on HLSL intangible type '__hlsl_resource_t'}}
16+
// expected-error@+1{{attribute 'raw_buffer' can be used only on HLSL intangible type '__hlsl_resource_t'}}
17+
float [[hlsl::resource_class(UAV)]] [[hlsl::raw_buffer]] res5;

clang/test/ParserHLSL/hlsl_resource_class_attr_error.hlsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ __hlsl_resource_t [[hlsl::resource_class(SRV)]] [[hlsl::resource_class(SRV)]] e4
1717

1818
// expected-error@+1{{'resource_class' attribute takes one argument}}
1919
__hlsl_resource_t [[hlsl::resource_class(SRV, "aa")]] e5;
20+
21+
// expected-error@+1{{attribute 'resource_class' can be used only on HLSL intangible type '__hlsl_resource_t'}}
22+
float [[hlsl::resource_class(UAV)]] e6;

clang/test/ParserHLSL/hlsl_resource_handle_attrs.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// CHECK: -ClassTemplateSpecializationDecl 0x{{[0-9a-f]+}} <<invalid sloc>> <invalid sloc> class RWBuffer definition implicit_instantiation
44
// CHECK: -TemplateArgument type 'float'
55
// CHECK: `-BuiltinType 0x{{[0-9a-f]+}} 'float'
6-
// CHECK: -FieldDecl 0x{{[0-9a-f]+}} <<invalid sloc>> <invalid sloc> implicit referenced h 'float *
6+
// CHECK: -FieldDecl 0x{{[0-9a-f]+}} <<invalid sloc>> <invalid sloc> implicit h 'float *
77
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
88
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(float)]]
99
// CHECK-SAME: ':'float *'
@@ -14,7 +14,7 @@ RWBuffer<float> Buffer1;
1414
// CHECK: -TemplateArgument type 'vector<float, 4>'
1515
// CHECK: `-ExtVectorType 0x{{[0-9a-f]+}} 'vector<float, 4>' 4
1616
// CHECK: `-BuiltinType 0x{{[0-9a-f]+}} 'float'
17-
// CHECK: -FieldDecl 0x{{[0-9a-f]+}} <<invalid sloc>> <invalid sloc> implicit referenced h 'vector<float *, 4>
17+
// CHECK: -FieldDecl 0x{{[0-9a-f]+}} <<invalid sloc>> <invalid sloc> implicit h 'vector<float *, 4>
1818
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]
1919
// CHECK-SAME{LITERAL}: [[hlsl::is_rov]]
2020
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(vector<float, 4>)]]

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@
172172
WATCHPOINT_CREATED = "Watchpoint created successfully"
173173

174174

175-
def CMD_MSG(str):
175+
def CMD_MSG(command):
176176
"""A generic "Command '%s' did not return successfully" message generator."""
177-
return "Command '%s' did not return successfully" % str
177+
return f"Command '{command}' did not return successfully"
178178

179179

180180
def COMPLETION_MSG(str_before, str_after, completions):
@@ -990,16 +990,14 @@ def runCmd(self, cmd, msg=None, check=True, trace=False, inHistory=False):
990990
print("Command '" + cmd + "' failed!", file=sbuf)
991991

992992
if check:
993+
if not msg:
994+
msg = CMD_MSG(cmd)
993995
output = ""
994996
if self.res.GetOutput():
995997
output += "\nCommand output:\n" + self.res.GetOutput()
996998
if self.res.GetError():
997999
output += "\nError output:\n" + self.res.GetError()
998-
if msg:
999-
msg += output
1000-
if cmd:
1001-
cmd += output
1002-
self.assertTrue(self.res.Succeeded(), msg if (msg) else CMD_MSG(cmd))
1000+
self.assertTrue(self.res.Succeeded(), msg + output)
10031001

10041002
def HideStdout(self):
10051003
"""Hide output to stdout from the user.

lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,46 @@ def minidump_deleted_on_save_failure(self):
522522

523523
finally:
524524
self.assertTrue(self.dbg.DeleteTarget(target))
525+
526+
def minidump_deterministic_difference(self):
527+
"""Test that verifies that two minidumps produced are identical."""
528+
529+
self.build()
530+
exe = self.getBuildArtifact("a.out")
531+
try:
532+
target = self.dbg.CreateTarget(exe)
533+
process = target.LaunchSimple(
534+
None, None, self.get_process_working_directory()
535+
)
536+
self.assertState(process.GetState(), lldb.eStateStopped)
537+
538+
core_styles = [
539+
lldb.eSaveCoreStackOnly,
540+
lldb.eSaveCoreDirtyOnly,
541+
lldb.eSaveCoreFull,
542+
]
543+
for style in core_styles:
544+
spec_one = lldb.SBFileSpec(self.getBuildArtifact("core.one.dmp"))
545+
spec_two = lldb.SBFileSpec(self.getBuildArtifact("core.two.dmp"))
546+
options = lldb.SBSaveCoreOptions()
547+
options.SetOutputFile(spec_one)
548+
options.SetPluginName("minidump")
549+
options.SetStyle(style)
550+
error = process.SaveCore(options)
551+
self.assertTrue(error.Success())
552+
options.SetOutputFile(spec_two)
553+
error = process.SaveCore(options)
554+
self.assertTrue(error.Success())
555+
556+
file_one = None
557+
file_two = None
558+
with open(spec_one.GetFileName(), mode="rb") as file:
559+
file_one = file.read()
560+
with open(spec_two.GetFileName(), mode="rb") as file:
561+
file_two = file.read()
562+
self.assertEqual(file_one, file_two)
563+
self.assertTrue(os.unlink(spec_one.GetFileName()))
564+
self.assertTrue(os.unlink(spec_two.GetFileName()))
565+
566+
finally:
567+
self.assertTrue(self.dbg.DeleteTarget(target))

llvm/docs/GlobalISel/GenericOpcode.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ G_FCEIL, G_FSQRT, G_FFLOOR, G_FRINT, G_FNEARBYINT
633633

634634
These correspond to the standard C functions of the same name.
635635

636-
G_FCOS, G_FSIN, G_FTAN, G_FACOS, G_FASIN, G_FATAN, G_FCOSH, G_FSINH, G_FTANH
637-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
636+
G_FCOS, G_FSIN, G_FTAN, G_FACOS, G_FASIN, G_FATAN, G_FATAN2, G_FCOSH, G_FSINH, G_FTANH
637+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
638638

639639
These correspond to the standard C trigonometry functions of the same name.
640640

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 513194
19+
#define LLVM_MAIN_REVISION 513210
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/include/llvm/IR/IntrinsicsDirectX.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ def int_dx_group_id : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem, IntrWi
1717
def int_dx_thread_id_in_group : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem, IntrWillReturn]>;
1818
def int_dx_flattened_thread_id_in_group : Intrinsic<[llvm_i32_ty], [], [IntrNoMem, IntrWillReturn]>;
1919

20-
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
21-
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
22-
2320
// Create resource handle given binding information. Returns a `target("dx.")`
2421
// type appropriate for the kind of resource given a register space ID, lower
2522
// bound and range size of the binding, as well as an index and an indicator

llvm/include/llvm/IR/IntrinsicsSPIRV.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ let TargetPrefix = "spv" in {
5959

6060
// The following intrinsic(s) are mirrored from IntrinsicsDirectX.td for HLSL support.
6161
def int_spv_thread_id : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem, IntrWillReturn]>;
62-
def int_spv_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
63-
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
6462
def int_spv_all : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_any_ty]>;
6563
def int_spv_any : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_any_ty]>;
6664
def int_spv_frac : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty]>;

llvm/include/llvm/SandboxIR/Context.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace llvm::sandboxir {
1818
class Module;
1919
class Value;
2020
class Argument;
21+
class Constant;
2122

2223
class Context {
2324
protected:
@@ -69,9 +70,8 @@ class Context {
6970
return getOrCreateValueInternal(LLVMV, 0);
7071
}
7172
/// Get or create a sandboxir::Constant from an existing LLVM IR \p LLVMC.
72-
Constant *getOrCreateConstant(llvm::Constant *LLVMC) {
73-
return cast<Constant>(getOrCreateValueInternal(LLVMC, 0));
74-
}
73+
Constant *getOrCreateConstant(llvm::Constant *LLVMC);
74+
7575
// Friends for getOrCreateConstant().
7676
#define DEF_CONST(ID, CLASS) friend class CLASS;
7777
#include "llvm/SandboxIR/SandboxIRValues.def"
@@ -158,9 +158,7 @@ class Context {
158158
friend FCmpInst; // For createFCmpInst()
159159

160160
public:
161-
Context(LLVMContext &LLVMCtx)
162-
: LLVMCtx(LLVMCtx), IRTracker(*this),
163-
LLVMIRBuilder(LLVMCtx, ConstantFolder()) {}
161+
Context(LLVMContext &LLVMCtx);
164162

165163
Tracker &getTracker() { return IRTracker; }
166164
/// Convenience function for `getTracker().save()`

0 commit comments

Comments
 (0)