diff options
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index cd781cdc2eb..d1afed0fb58 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1563,8 +1563,7 @@ public: /// \return Returns information about the register usages of the loop for the /// given vectorization factors. - SmallVector<RegisterUsage, 8> - calculateRegisterUsage(const SmallVector<unsigned, 8> &VFs); + SmallVector<RegisterUsage, 8> calculateRegisterUsage(ArrayRef<unsigned> VFs); private: /// The vectorization cost is a combination of the cost itself and a boolean @@ -4341,7 +4340,9 @@ void InnerLoopVectorizer::vectorizeBlockInLoop(BasicBlock *BB, PhiVector *PV) { } assert(VectorF && "Can't create vector function."); - CallInst *V = Builder.CreateCall(VectorF, Args); + SmallVector<OperandBundleDef, 1> OpBundles; + CI->getOperandBundlesAsDefs(OpBundles); + CallInst *V = Builder.CreateCall(VectorF, Args, OpBundles); if (isa<FPMathOperator>(V)) V->copyFastMathFlags(CI); @@ -5509,8 +5510,7 @@ unsigned LoopVectorizationCostModel::selectInterleaveCount(bool OptForSize, } SmallVector<LoopVectorizationCostModel::RegisterUsage, 8> -LoopVectorizationCostModel::calculateRegisterUsage( - const SmallVector<unsigned, 8> &VFs) { +LoopVectorizationCostModel::calculateRegisterUsage(ArrayRef<unsigned> VFs) { // This function calculates the register usage by measuring the highest number // of values that are alive at a single location. Obviously, this is a very // rough estimation. We scan the loop in a topological order in order and @@ -5602,6 +5602,8 @@ LoopVectorizationCostModel::calculateRegisterUsage( // A lambda that gets the register usage for the given type and VF. auto GetRegUsage = [&DL, WidestRegister](Type *Ty, unsigned VF) { + if (Ty->isTokenTy()) + return 0U; unsigned TypeSize = DL.getTypeSizeInBits(Ty->getScalarType()); return std::max<unsigned>(1, VF * TypeSize / WidestRegister); }; |

