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 @@ -243,15 +243,6 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) {
243243 if (!canWidenLoad (Load, TTI))
244244 return false ;
245245
246- auto MaxCommonDivisor = [](int n) {
247- if (n % 4 == 0 )
248- return 4 ;
249- if (n % 2 == 0 )
250- return 2 ;
251- else
252- return 1 ;
253- };
254-
255246 Type *ScalarTy = Scalar->getType ();
256247 uint64_t ScalarSize = ScalarTy->getPrimitiveSizeInBits ();
257248 unsigned MinVectorSize = TTI.getMinVectorRegisterBitWidth ();
@@ -295,7 +286,7 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) {
295286 uint64_t OldScalarSizeInBytes = ScalarSizeInBytes;
296287 // Assign the greatest common divisor between UnalignedBytes and Offset to
297288 // ScalarSizeInBytes
298- ScalarSizeInBytes = MaxCommonDivisor ( UnalignedBytes);
289+ ScalarSizeInBytes = std::gcd (ScalarSizeInBytes, UnalignedBytes);
299290 ScalarSize = ScalarSizeInBytes * 8 ;
300291 VectorRange = OldScalarSizeInBytes / ScalarSizeInBytes;
301292 MinVecNumElts = MinVectorSize / ScalarSize;
You can’t perform that action at this time.
0 commit comments