[PATCH] D88982: [NFCI] Add LinearPolyBase as base class for ElementCount, TypeSize and StackOffset.
Christopher Tetreault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 26 13:00:56 PDT 2020
ctetreau added inline comments.
================
Comment at: llvm/include/llvm/Support/TypeSize.h:34
-// TODO: This class will be redesigned in a later patch that introduces full
-// polynomial behaviour, i.e. the ability to have composites made up of both
-// fixed and scalable sizes.
-template <typename T> class PolySize {
-protected:
- T MinVal; // The minimum value that it could be.
- bool IsScalable; // If true, the total value is determined by multiplying
- // 'MinVal' by a runtime determinded quantity, 'vscale'.
+template <typename LeafTy> struct LinearPolyBaseTypeTraits {};
----------------
sdesmalen wrote:
> ctetreau wrote:
> > Couldn't we just require that any type used as `LeafTy` have a `ScalarTy` typedef?
> When I try that, I get:
> ```error: invalid use of incomplete type 'class llvm::StackOffset'
> 55 | using SomeOtherTy = typename LeafTy::SomeTy;
> | ^~~~~~~~~~~
> ```
I played around with it for a bit today, and I was unable to make it any nicer.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88982/new/
https://reviews.llvm.org/D88982
More information about the llvm-commits
mailing list