Skip to content

Commit ccbbacf

Browse files
committed
[ARM] Fix MVE incrementing gather offset calculation
The code was checking the gep ptr type as opposed to the gep source element type in calculating the offset scale. Fixes #120993
1 parent df12983 commit ccbbacf

File tree

2 files changed

+191
-136
lines changed

2 files changed

+191
-136
lines changed

llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ Instruction *MVEGatherScatterLowering::tryCreateIncrementingGatScat(
752752
// The gep was in charge of making sure the offsets are scaled correctly
753753
// - calculate that factor so it can be applied by hand
754754
int TypeScale =
755-
computeScale(DL->getTypeSizeInBits(GEP->getOperand(0)->getType()),
755+
computeScale(DL->getTypeSizeInBits(GEP->getSourceElementType()),
756756
DL->getTypeSizeInBits(GEP->getType()) /
757757
cast<FixedVectorType>(GEP->getType())->getNumElements());
758758
if (TypeScale == -1)

0 commit comments

Comments
 (0)