diff options
| author | Clement Courbet <courbet@google.com> | 2017-04-21 09:20:39 +0000 |
|---|---|---|
| committer | Clement Courbet <courbet@google.com> | 2017-04-21 09:20:39 +0000 |
| commit | 1ce3b82dea8eb35e77974fc9d97f9a08c690c53d (patch) | |
| tree | 10718c7c21b90322462a789d671de895ccb18d54 /llvm/lib/Target/X86/X86.td | |
| parent | f8a964252643c4e65d0c091105cc9d4cbe813690 (diff) | |
| download | bcm5719-llvm-1ce3b82dea8eb35e77974fc9d97f9a08c690c53d.tar.gz bcm5719-llvm-1ce3b82dea8eb35e77974fc9d97f9a08c690c53d.zip | |
X86 memcpy: use REPMOVSB instead of REPMOVS{Q,D,W} for inline copies
when the subtarget has fast strings.
This has two advantages:
- Speed is improved. For example, on Haswell thoughput improvements increase
linearly with size from 256 to 512 bytes, after which they plateau:
(e.g. 1% for 260 bytes, 25% for 400 bytes, 40% for 508 bytes).
- Code is much smaller (no need to handle boundaries).
llvm-svn: 300957
Diffstat (limited to 'llvm/lib/Target/X86/X86.td')
| -rw-r--r-- | llvm/lib/Target/X86/X86.td | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86.td b/llvm/lib/Target/X86/X86.td index 8fcc8e31d5d..99d6c6932ae 100644 --- a/llvm/lib/Target/X86/X86.td +++ b/llvm/lib/Target/X86/X86.td @@ -273,6 +273,13 @@ def FeatureFastSHLDRotate "fast-shld-rotate", "HasFastSHLDRotate", "true", "SHLD can be used as a faster rotate">; +// String operations (e.g. REP MOVS) are fast. See "REP String Enhancement" in +// the Intel Software Development Manual. +def FeatureFastString + : SubtargetFeature< + "fast-string", "HasFastString", "true", + "REP MOVS/STOS are fast">; + //===----------------------------------------------------------------------===// // X86 processors supported. //===----------------------------------------------------------------------===// @@ -498,6 +505,7 @@ def HSWFeatures : ProcessorFeatures<IVBFeatures.Value, [ FeatureAVX2, FeatureBMI, FeatureBMI2, + FeatureFastString, FeatureFMA, FeatureLZCNT, FeatureMOVBE, |

