[PATCH] D88982: [NFCI] Add PolyBase as base class for ElementCount, TypeSize and StackOffset.
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 10:03:45 PDT 2020
sdesmalen created this revision.
sdesmalen added reviewers: ctetreau, efriedma, david-arm, paulwalker-arm, vkmr.
Herald added subscribers: tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini.
Herald added a reviewer: ftynse.
Herald added projects: MLIR, LLVM.
sdesmalen requested review of this revision.
Herald added subscribers: stephenneuendorffer, nicolasvasilache.
This patch adds a true polynomial base class, called PolyBase, which
serves as a base class for ElementCount, TypeSize and StackOffset.
It tries to represent a true polynomial like:
c0 * scale0 + c1 * scale1 + ... + cK * scaleK
where the scale is implicit, meaning that only the coefficients are
encoded. From PolyBase, other base classes are derived:
PolyBase<Type, Dimensions, DimensionIsExclusive>
^
|
+---- MixedPolyBase2D : PolyBase<Type, 2, false>
^ ^
| |
| +------------- StackOffset (subclass with Type=int64_t)
|
+---- SinglePolyBase2D : PolyBase<Type, 2, true>
^
|
+------------- ElementCount (typedef with Type=unsigned)
|
+------------- TypeSize (subclass with Type=uint64_t)
The plan is for TypeSize to become a typedef as well.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D88982
Files:
llvm/include/llvm/Support/TypeSize.h
mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88982.296720.patch
Type: text/x-patch
Size: 20518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201007/234be503/attachment.bin>
More information about the llvm-commits
mailing list