Skip to content

Commit e881133

Browse files
committed
Remove NFC refactor of BE element scaling
1 parent c7169eb commit e881133

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static Instruction *foldVecExtTruncToExtElt(TruncInst &Trunc,
477477
uint64_t BitCastNumElts = VecElts.getKnownMinValue() * TruncRatio;
478478
uint64_t VecOpIdx = Cst->getZExtValue();
479479
uint64_t NewIdx = IC.getDataLayout().isBigEndian()
480-
? (VecOpIdx * TruncRatio) + (TruncRatio - 1)
480+
? (VecOpIdx + 1) * TruncRatio - 1
481481
: VecOpIdx * TruncRatio;
482482

483483
// Adjust index by the whole number of truncated elements.

0 commit comments

Comments
 (0)