TableGen: Add !size operation

Description

TableGen: Add !size operation

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

Details

Committed
nhaFeb 23 2018, 2:46 AM
Differential Revision
D43553: TableGen: Add !size operation
Parents
rL325882: AMDGPU: Track physreg uses in SILoadStoreOptimizer
Branches
Unknown
Tags
Unknown