[PATCH] D126885: [SLP]Cost for a constant buildvector.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 3 15:24:08 PDT 2022
ABataev added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5807
+ auto *CI = cast<ConstantInt>(V);
+ ScalarCost += TTI->getIntImmCostInst(
+ UserOpcode, UserIdx, CI->getValue(), ScalarTy, CostKind);
----------------
vdmitrie wrote:
> Isn't this interface already puts assumption that a constant is a legal immediate?
> I was trying to explore this too and I found that it does not seem to cover correctly 32bit target specifically for 64bit operations. Ideally we should have interface that tells whether immediate is a legal imm operand for a target but I have not found anything like that.
> One way to figure this (which I found -may be wrongful) is
> when condition
> DL->getTypeStoreSizeInBits(ScalarTy) > DL->getLargestLegalIntTypeSizeInBits()
> is true we cannot assume operand as a legal immediate.
I'll check it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126885/new/
https://reviews.llvm.org/D126885
More information about the llvm-commits
mailing list