[PATCH] D49225: [SLPVectorizer] Move scalar/vector costs to helper functions (NFCI).
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 17 03:51:21 PDT 2018
RKSimon added inline comments.
================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:609-610
+ /// \returns the cost of the scalar instruction \p I.
+ int getScalarCost(Instruction *I, Type *DstSclTy);
+
----------------
ABataev wrote:
> RKSimon wrote:
> > ABataev wrote:
> > > Can we just use `TTI->getInstructionCost(I, TargetTransformInfo::TCK_RecipThroughput);` instead of this function?
> > I've kept more closely to the original code than might be necessary - more of the instructions could use TTI->getInstructionCost directly in the switch statements - but enums like GEP and Cast have minor diffs that we seem to be relying on....
> Can we use this for load, store and calls?
Load/Store could use TTI->getInstructionCost but it will mean we're not hard coding the address space to 0 anymore (we'll use the StoreInst/LoadInst getPointerAddressSpace())
Call should be fine - we might want to keep an assert to check that its an IntrinsicInst type.
Repository:
rL LLVM
https://reviews.llvm.org/D49225
More information about the llvm-commits
mailing list