summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-08-22 20:15:04 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-08-22 20:15:04 +0000
commit2ff9aa15e46f92c6325e40023fa7581c2becddd0 (patch)
treea236e279c9d13aaa08941726a7297acabc31f8d3 /llvm/lib
parentc11e2b94700e98606150db233e53b220431a5be2 (diff)
downloadbcm5719-llvm-2ff9aa15e46f92c6325e40023fa7581c2becddd0.tar.gz
bcm5719-llvm-2ff9aa15e46f92c6325e40023fa7581c2becddd0.zip
[Hexagon] Enable interleaving in loop vectorizer
llvm-svn: 340447
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp6
-rw-r--r--llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
index a496a17788d..4d0e7dc52e8 100644
--- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
@@ -207,8 +207,10 @@ unsigned HexagonTTIImpl::getGatherScatterOpCost(unsigned Opcode, Type *DataTy,
unsigned HexagonTTIImpl::getInterleavedMemoryOpCost(unsigned Opcode,
Type *VecTy, unsigned Factor, ArrayRef<unsigned> Indices,
unsigned Alignment, unsigned AddressSpace) {
- return BaseT::getInterleavedMemoryOpCost(Opcode, VecTy, Factor, Indices,
- Alignment, AddressSpace);
+ if (Indices.size() != Factor)
+ return BaseT::getInterleavedMemoryOpCost(Opcode, VecTy, Factor, Indices,
+ Alignment, AddressSpace);
+ return getMemoryOpCost(Opcode, VecTy, Alignment, AddressSpace, nullptr);
}
unsigned HexagonTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h
index a232f99fc40..2c03cd268ff 100644
--- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h
+++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h
@@ -98,6 +98,9 @@ public:
bool prefersVectorizedAddressing() {
return false;
}
+ bool enableInterleavedAccessVectorization() {
+ return true;
+ }
unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract);
unsigned getOperandsScalarizationOverhead(ArrayRef<const Value*> Args,
OpenPOWER on IntegriCloud