[PATCH] D91059: [LoopVectorizer] NFCI: Calculate register usage based on TLI.getTypeLegalizationCost.
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 9 07:38:10 PST 2020
SjoerdMeijer added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:297
+ unsigned getRegUsageForType(Type *Ty) {
+ return getTLI()->getTypeLegalizationCost(DL, Ty).first;
+ }
----------------
sdesmalen wrote:
> SjoerdMeijer wrote:
> > If it's only about this, perhaps better not to create yet another TTI hook? Perhaps just query `getTypeLegalizationCost` directly in the LV?
> I wasn't sure if this was by design, but `TLI` is currently not a member of the LoopVectorizer. I'm happy to add it, but I thought it had to go through TTI so that target lowering is abstracted from the more high-level loop-vectorization pass.
Ah sorry, looking at it closer, I think you're right, calling this from the LV would be a layering violation....
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91059/new/
https://reviews.llvm.org/D91059
More information about the llvm-commits
mailing list