summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Kuperstein <mkuper@google.com>2016-10-20 21:04:31 +0000
committerMichael Kuperstein <mkuper@google.com>2016-10-20 21:04:31 +0000
commitb2443ed62bcf393693eedb9e789e4198f4e460cd (patch)
tree19fa5386500e9b6a671e8c605e7dd621d736428d /llvm/lib
parent2b81f42a76a58a23c358f6d72b65385c0073f94f (diff)
downloadbcm5719-llvm-b2443ed62bcf393693eedb9e789e4198f4e460cd.tar.gz
bcm5719-llvm-b2443ed62bcf393693eedb9e789e4198f4e460cd.zip
[X86] Enable interleaved memory access by default
This lets the loop vectorizer generate interleaved memory accesses on x86. Differential Revision: https://reviews.llvm.org/D25350 llvm-svn: 284779
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp7
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index e14220807c8..7f6dc2b2164 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -1767,3 +1767,10 @@ bool X86TTIImpl::areInlineCompatible(const Function *Caller,
// correct.
return (CallerBits & CalleeBits) == CalleeBits;
}
+
+bool X86TTIImpl::enableInterleavedAccessVectorization() {
+ // TODO: We expect this to be beneficial regardless of arch,
+ // but there are currently some unexplained performance artifacts on Atom.
+ // As a temporary solution, disable on Atom.
+ return !(ST->isAtom() || ST->isSLM());
+}
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.h b/llvm/lib/Target/X86/X86TargetTransformInfo.h
index 1985e42c9b2..4c256630e92 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.h
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.h
@@ -93,6 +93,8 @@ public:
bool isLegalMaskedScatter(Type *DataType);
bool areInlineCompatible(const Function *Caller,
const Function *Callee) const;
+
+ bool enableInterleavedAccessVectorization();
private:
int getGSScalarCost(unsigned Opcode, Type *DataTy, bool VariableMask,
unsigned Alignment, unsigned AddressSpace);
OpenPOWER on IntegriCloud