[PATCH] D43553: TableGen: Add !size operation
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 02:40:42 PST 2018
nhaehnle created this revision.
nhaehnle added reviewers: arsenm, craig.topper, tra, MartinO.
Herald added subscribers: tpr, wdng.
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
Repository:
rL LLVM
https://reviews.llvm.org/D43553
Files:
docs/TableGen/LangRef.rst
include/llvm/TableGen/Record.h
lib/TableGen/Record.cpp
lib/TableGen/TGLexer.cpp
lib/TableGen/TGLexer.h
lib/TableGen/TGParser.cpp
test/TableGen/size.td
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43553.135214.patch
Type: text/x-patch
Size: 4544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180221/5ef5da62/attachment.bin>
More information about the llvm-commits
mailing list