Skip to content

Commit 4a093b1

Browse files
committed
[LAA] Get effective SCEV type
1 parent f852718 commit 4a093b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,20 +1001,20 @@ static void findForkedSCEVs(
10011001
break;
10021002
}
10031003

1004-
Type *PtrTy = GEP->getPointerOperandType();
1004+
Type *IntPtrTy = SE->getEffectiveSCEVType(GEP->getPointerOperandType());
10051005

10061006
// Find the size of the type being pointed to. We only have a single
10071007
// index term (guarded above) so we don't need to index into arrays or
10081008
// structures, just get the size of the scalar value.
1009-
const SCEV *Size = SE->getSizeOfExpr(PtrTy, SourceTy);
1009+
const SCEV *Size = SE->getSizeOfExpr(IntPtrTy, SourceTy);
10101010

10111011
for (auto [B, O] : zip(BaseScevs, OffsetScevs)) {
10121012
const SCEV *Base = get<0>(B);
10131013
const SCEV *Offset = get<0>(O);
10141014

10151015
// Scale up the offsets by the size of the type, then add to the bases.
10161016
const SCEV *Scaled =
1017-
SE->getMulExpr(Size, SE->getTruncateOrSignExtend(Offset, PtrTy));
1017+
SE->getMulExpr(Size, SE->getTruncateOrSignExtend(Offset, IntPtrTy));
10181018
ScevList.emplace_back(SE->getAddExpr(Base, Scaled), NeedsFreeze);
10191019
}
10201020
break;

0 commit comments

Comments
 (0)