Skip to content

Commit 0fc49fc

Browse files
committed
[LAA] Fix SCEV mul at different bitwidth
1 parent df24c96 commit 0fc49fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -999,15 +999,15 @@ static void findForkedSCEVs(
999999
break;
10001000
}
10011001

1002+
Type *PtrTy = GEP->getPointerOperandType();
10021003
for (auto [B, O] : zip(BaseScevs, OffsetScevs)) {
10031004
const SCEV *Base = get<0>(B);
10041005
const SCEV *Offset = get<0>(O);
10051006

10061007
// Scale up the offsets by the size of the type, then add to the bases.
1007-
const SCEV *Scaled = SE->getTruncateOrSignExtend(
1008-
SE->getMulExpr(SE->getSizeOfExpr(Offset->getType(), SourceTy),
1009-
Offset),
1010-
Base->getType());
1008+
const SCEV *Scaled =
1009+
SE->getMulExpr(SE->getSizeOfExpr(PtrTy, SourceTy),
1010+
SE->getTruncateOrSignExtend(Offset, PtrTy));
10111011
ScevList.emplace_back(SE->getAddExpr(Base, Scaled), NeedsFreeze);
10121012
}
10131013
break;

0 commit comments

Comments
 (0)