-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[TableGen] Refactor Intrinsics record #106986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,10 @@ | ||
// RUN: llvm-tblgen -gen-intrinsic-enums %s | FileCheck %s | ||
// RUN: llvm-tblgen -gen-intrinsic-enums -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS | FileCheck %s | ||
// XFAIL: vg_leak | ||
|
||
class IntrinsicProperty<bit is_default = 0> { | ||
bit IsDefault = is_default; | ||
} | ||
|
||
class SDNodeProperty; | ||
|
||
class ValueType<int size, int value> { | ||
string Namespace = "MVT"; | ||
int Size = size; | ||
int Value = value; | ||
} | ||
|
||
class LLVMType<ValueType vt> { | ||
ValueType VT = vt; | ||
} | ||
|
||
class Intrinsic<string name, list<LLVMType> param_types = []> { | ||
string LLVMName = name; | ||
bit isTarget = 0; | ||
string TargetPrefix = ""; | ||
list<LLVMType> RetTypes = []; | ||
list<LLVMType> ParamTypes = param_types; | ||
list<IntrinsicProperty> IntrProperties = []; | ||
list<SDNodeProperty> Properties = []; | ||
bit DisableDefaultAttributes = 1; | ||
} | ||
|
||
def iAny : ValueType<0, 253>; | ||
def llvm_anyint_ty : LLVMType<iAny>; | ||
include "llvm/IR/Intrinsics.td" | ||
|
||
// Make sure we generate the long name without crashing | ||
// CHECK: this_is_a_really_long_intrinsic_name_but_we_should_still_not_crash, // llvm.this.is.a.really.long.intrinsic.name.but.we.should.still.not.crash | ||
def int_foo : Intrinsic<"llvm.foo", [llvm_anyint_ty]>; | ||
def int_this_is_a_really_long_intrinsic_name_but_we_should_still_not_crash : Intrinsic<"llvm.this.is.a.really.long.intrinsic.name.but.we.should.still.not.crash", [llvm_anyint_ty]>; | ||
def int_foo : Intrinsic<[llvm_anyint_ty], [], [], "llvm.foo">; | ||
def int_this_is_a_really_long_intrinsic_name_but_we_should_still_not_crash : Intrinsic<[llvm_anyint_ty], [], [], "llvm.this.is.a.really.long.intrinsic.name.but.we.should.still.not.crash">; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,11 @@ | ||
// RUN: llvm-tblgen -gen-intrinsic-enums %s | FileCheck %s | ||
// RUN: llvm-tblgen -gen-intrinsic-enums -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS | FileCheck %s | ||
// XFAIL: vg_leak | ||
|
||
class IntrinsicProperty<bit is_default = 0> { | ||
bit IsDefault = is_default; | ||
} | ||
|
||
class SDNodeProperty; | ||
|
||
class ValueType<int size, int value> { | ||
string Namespace = "MVT"; | ||
int Size = size; | ||
int Value = value; | ||
} | ||
|
||
class LLVMType<ValueType vt> { | ||
ValueType VT = vt; | ||
} | ||
|
||
class Intrinsic<string name, list<LLVMType> ret_types = []> { | ||
string LLVMName = name; | ||
bit isTarget = 0; | ||
string TargetPrefix = ""; | ||
list<LLVMType> RetTypes = ret_types; | ||
list<LLVMType> ParamTypes = []; | ||
list<IntrinsicProperty> IntrProperties = []; | ||
list<SDNodeProperty> Properties = []; | ||
bit DisableDefaultAttributes = 1; | ||
} | ||
|
||
def iAny : ValueType<0, 253>; | ||
def llvm_anyint_ty : LLVMType<iAny>; | ||
include "llvm/IR/Intrinsics.td" | ||
|
||
// Make sure we can return up to 8 values | ||
// CHECK: returns_8_results = {{[0-9]+}}, // llvm.returns.8.results | ||
def int_returns_8_results : Intrinsic<"llvm.returns.8.results", | ||
def int_returns_8_results : Intrinsic< | ||
[llvm_anyint_ty, llvm_anyint_ty, llvm_anyint_ty, llvm_anyint_ty, | ||
llvm_anyint_ty, llvm_anyint_ty, llvm_anyint_ty, llvm_anyint_ty]>; | ||
llvm_anyint_ty, llvm_anyint_ty, llvm_anyint_ty, llvm_anyint_ty], | ||
[], [], "llvm.returns.8.results">; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.