diff options
author | Zheng Chen <czhengsz@cn.ibm.com> | 2021-08-06 16:29:47 +0000 |
---|---|---|
committer | Jinsong Ji <jji@us.ibm.com> | 2021-08-06 16:51:09 +0000 |
commit | 30b0c455b150c9e29f2a4f500fa721dea82d5e37 (patch) | |
tree | 30ab59d7fc215fa6aba61814165fb98cd8de1ba3 /llvm/lib/Analysis/LoopCacheAnalysis.cpp | |
parent | eae4a44c1d4b3352443dc0021149fb9ca45d5727 (diff) | |
download | llvm-30b0c455b150c9e29f2a4f500fa721dea82d5e37.zip llvm-30b0c455b150c9e29f2a4f500fa721dea82d5e37.tar.gz llvm-30b0c455b150c9e29f2a4f500fa721dea82d5e37.tar.bz2 |
[LoopCacheAnalysis]: handle mismatch type for Numerator and CacheLineSize
fix an assertion due to mismatch type for Numerator and CacheLineSize in loop cache analysis pass.
Reviewed By: bmahjour
Differential Revision: https://reviews.llvm.org/D107618
Diffstat (limited to 'llvm/lib/Analysis/LoopCacheAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopCacheAnalysis.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopCacheAnalysis.cpp b/llvm/lib/Analysis/LoopCacheAnalysis.cpp index 8a61364..772e4eb23 100644 --- a/llvm/lib/Analysis/LoopCacheAnalysis.cpp +++ b/llvm/lib/Analysis/LoopCacheAnalysis.cpp @@ -290,8 +290,8 @@ CacheCostTy IndexedReference::computeRefCost(const Loop &L, const SCEV *Coeff = getLastCoefficient(); const SCEV *ElemSize = Sizes.back(); const SCEV *Stride = SE.getMulExpr(Coeff, ElemSize); - const SCEV *CacheLineSize = SE.getConstant(Stride->getType(), CLS); Type *WiderType = SE.getWiderType(Stride->getType(), TripCount->getType()); + const SCEV *CacheLineSize = SE.getConstant(WiderType, CLS); if (SE.isKnownNegative(Stride)) Stride = SE.getNegativeSCEV(Stride); Stride = SE.getNoopOrAnyExtend(Stride, WiderType); |