File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -205,15 +205,6 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) {
205
205
if (!canWidenLoad (Load, TTI))
206
206
return false ;
207
207
208
- auto MaxCommonDivisor = [](int n) {
209
- if (n % 4 == 0 )
210
- return 4 ;
211
- if (n % 2 == 0 )
212
- return 2 ;
213
- else
214
- return 1 ;
215
- };
216
-
217
208
Type *ScalarTy = Scalar->getType ();
218
209
uint64_t ScalarSize = ScalarTy->getPrimitiveSizeInBits ();
219
210
unsigned MinVectorSize = TTI.getMinVectorRegisterBitWidth ();
@@ -255,7 +246,7 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) {
255
246
uint64_t OldScalarSizeInBytes = ScalarSizeInBytes;
256
247
// Assign the greatest common divisor between UnalignedBytes and Offset to
257
248
// ScalarSizeInBytes
258
- ScalarSizeInBytes = MaxCommonDivisor ( UnalignedBytes);
249
+ ScalarSizeInBytes = std::gcd (ScalarSizeInBytes, UnalignedBytes);
259
250
ScalarSize = ScalarSizeInBytes * 8 ;
260
251
VectorRange = OldScalarSizeInBytes / ScalarSizeInBytes;
261
252
MinVecNumElts = MinVectorSize / ScalarSize;
You can’t perform that action at this time.
0 commit comments