[PATCH] D92178: [InstructionCost] Change LoopVectorizationCostModel::getInstructionCost to return InstructionCost
Christopher Tetreault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 09:56:53 PST 2020
ctetreau added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5441
VectorizationCostTy C = expectedCost(ElementCount::getFixed(i));
- std::pair<unsigned, unsigned> VectorCost = {C.first, i};
+ std::pair<InstructionCost, unsigned> VectorCost = {C.first, i};
LLVM_DEBUG(dbgs() << "LV: Vector loop of width " << i
----------------
I think you can get rid of these pairs if you just check validity before assigning it.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5444
<< " costs: " << (C.first / i) << ".\n");
if (!C.second && !ForceVectorization) {
LLVM_DEBUG(
----------------
ForceVectorization needs to not blow up in the face of invalid `InstructionCost`s
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92178/new/
https://reviews.llvm.org/D92178
More information about the llvm-commits
mailing list