diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-06-20 15:58:30 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-06-20 15:58:30 +0000 |
commit | 0656629b870ae9933e350c5f4edc733012e7ece0 (patch) | |
tree | 82fc84249670cc54145d258342581ecd40b81bec /llvm/lib/Target/X86/X86TargetTransformInfo.cpp | |
parent | 4822b5b649f0086aa8339c2def1dbdd303dcb257 (diff) | |
download | bcm5719-llvm-0656629b870ae9933e350c5f4edc733012e7ece0.tar.gz bcm5719-llvm-0656629b870ae9933e350c5f4edc733012e7ece0.zip |
[x86] enable CGP memcmp() expansion for 2/4/8 byte sizes
There are a couple of potential improvements as seen in the IR and asm:
1. We're unnecessarily extending to a larger type to compare values.
2. The codegen for (select cond, 1, -1) could avoid a cmov.
(or we could change the order of the compares, so we have a select with 0 operand)
llvm-svn: 305802
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index 1d58cccc308..f13933e9288 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -2232,6 +2232,12 @@ bool X86TTIImpl::areInlineCompatible(const Function *Caller, return (CallerBits & CalleeBits) == CalleeBits; } +bool X86TTIImpl::expandMemCmp(Instruction *I, unsigned &MaxLoadSize) { + // TODO: We can increase these based on available vector ops. + MaxLoadSize = ST->is64Bit() ? 8 : 4; + return true; +} + bool X86TTIImpl::enableInterleavedAccessVectorization() { // TODO: We expect this to be beneficial regardless of arch, // but there are currently some unexplained performance artifacts on Atom. |