-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary:
Returns the size of a list. I have found this to be rather useful in some
development for the AMDGPU backend where we could simplify our .td files
by concatenating list<LLVMType> for complex intrinsics. Doing so requires
us to compute the position argument for LLVMMatchType.
Basically, the usage is in a pattern that looks somewhat like this:
list<LLVMType> argtypes =
!listconcat(base,
[llvm_any_ty, LLVMMatchType<!size(base)>]);
Change-Id: I360a0b000fd488d18bea412228230fd93722bd2c
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits, tpr
Differential Revision: https://reviews.llvm.org/D43553
llvm-svn: 325883- Loading branch information
Showing
8 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // RUN: llvm-tblgen %s | FileCheck %s | ||
| // XFAIL: vg_leak | ||
|
|
||
| // CHECK: --- Defs --- | ||
|
|
||
| // CHECK: def A1 { | ||
| // CHECK: int Val = 0; | ||
| // CHECK: } | ||
|
|
||
| // CHECK: def A2 { | ||
| // CHECK: int Val = 3; | ||
| // CHECK: } | ||
|
|
||
| // CHECK: def B1 { | ||
| // CHECK: int Val = 0; | ||
| // CHECK: } | ||
|
|
||
| // CHECK: def B2 { | ||
| // CHECK: int Val = 2; | ||
| // CHECK: } | ||
|
|
||
| class A<list<int> L> { | ||
| int Val = !size(L); | ||
| } | ||
|
|
||
| class B<list<string> L> { | ||
| int Val = !size(L); | ||
| } | ||
|
|
||
| def A1 : A<[]>; | ||
| def A2 : A<[1, 1, 2]>; | ||
|
|
||
| def B1 : B<[]>; | ||
| def B2 : B<["a", "b"]>; |