diff options
| author | David Zarzycki <dave@znu.io> | 2019-10-31 12:30:53 +0200 |
|---|---|---|
| committer | David Zarzycki <dave@znu.io> | 2019-11-01 08:58:48 +0200 |
| commit | cb6822c9deb63b6c21263b3732e549fdc89c4bbf (patch) | |
| tree | 13d468e85bb18a1da9b900216f5cb1cab9366be1 /llvm/lib | |
| parent | a8a89c77ea3c16b45763fca6940bbfd3bef7884f (diff) | |
| download | bcm5719-llvm-cb6822c9deb63b6c21263b3732e549fdc89c4bbf.tar.gz bcm5719-llvm-cb6822c9deb63b6c21263b3732e549fdc89c4bbf.zip | |
[X86] Reland: Enable YMM memcmp with AVX1
Update TargetTransformInfo to allow AVX1 to use YMM registers for memcmp.
This is a follow up to D68632 which enabled XOR compares which made this possible.
This also updates the memcmp-optsize.ll test unlike the first patch.
https://reviews.llvm.org/D69658
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index 2f899b3947b..afbe965ff4f 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -3444,10 +3444,9 @@ X86TTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const { // version is not as fast for three way compare (see #33329). const unsigned PreferredWidth = ST->getPreferVectorWidth(); if (PreferredWidth >= 512 && ST->hasAVX512()) Options.LoadSizes.push_back(64); - if (PreferredWidth >= 256 && ST->hasAVX2()) Options.LoadSizes.push_back(32); + if (PreferredWidth >= 256 && ST->hasAVX()) Options.LoadSizes.push_back(32); if (PreferredWidth >= 128 && ST->hasSSE2()) Options.LoadSizes.push_back(16); - // All GPR and vector loads can be unaligned. SIMD compare requires integer - // vectors (SSE2/AVX2). + // All GPR and vector loads can be unaligned. Options.AllowOverlappingLoads = true; } if (ST->is64Bit()) { |

