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 ();
@@ -257,7 +248,7 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) {
257
248
uint64_t OldScalarSizeInBytes = ScalarSizeInBytes;
258
249
// Assign the greatest common divisor between UnalignedBytes and Offset to
259
250
// ScalarSizeInBytes
260
- ScalarSizeInBytes = MaxCommonDivisor ( UnalignedBytes);
251
+ ScalarSizeInBytes = std::gcd (ScalarSizeInBytes, UnalignedBytes);
261
252
ScalarSize = ScalarSizeInBytes * 8 ;
262
253
VectorRange = OldScalarSizeInBytes / ScalarSizeInBytes;
263
254
MinVecNumElts = MinVectorSize / ScalarSize;
You can’t perform that action at this time.
0 commit comments