[llvm] r272964 - TTI: Add hook for memory width to vectorize
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 16 14:43:12 PDT 2016
Author: arsenm
Date: Thu Jun 16 16:43:12 2016
New Revision: 272964
URL: http://llvm.org/viewvc/llvm-project?rev=272964&view=rev
Log:
TTI: Add hook for memory width to vectorize
Modified:
llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h
llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/trunk/lib/Analysis/TargetTransformInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h?rev=272964&r1=272963&r2=272964&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h Thu Jun 16 16:43:12 2016
@@ -442,6 +442,10 @@ public:
/// \return The width of the largest scalar or vector register type.
unsigned getRegisterBitWidth(bool Vector) const;
+ /// \return The bitwidth of the largest vector type that should be used to
+ /// load/store in the given address space.
+ unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const;
+
/// \return The size of a cache line in bytes.
unsigned getCacheLineSize() const;
@@ -659,6 +663,7 @@ public:
Type *Ty) = 0;
virtual unsigned getNumberOfRegisters(bool Vector) = 0;
virtual unsigned getRegisterBitWidth(bool Vector) = 0;
+ virtual unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) = 0;
virtual unsigned getCacheLineSize() = 0;
virtual unsigned getPrefetchDistance() = 0;
virtual unsigned getMinPrefetchStride() = 0;
@@ -839,6 +844,11 @@ public:
unsigned getRegisterBitWidth(bool Vector) override {
return Impl.getRegisterBitWidth(Vector);
}
+
+ unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) override {
+ return Impl.getLoadStoreVecRegBitWidth(AddrSpace);
+ }
+
unsigned getCacheLineSize() override {
return Impl.getCacheLineSize();
}
Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h?rev=272964&r1=272963&r2=272964&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h (original)
+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h Thu Jun 16 16:43:12 2016
@@ -268,6 +268,8 @@ public:
unsigned getRegisterBitWidth(bool Vector) { return 32; }
+ unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) { return 128; }
+
unsigned getCacheLineSize() { return 0; }
unsigned getPrefetchDistance() { return 0; }
Modified: llvm/trunk/lib/Analysis/TargetTransformInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp?rev=272964&r1=272963&r2=272964&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TargetTransformInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/TargetTransformInfo.cpp Thu Jun 16 16:43:12 2016
@@ -224,6 +224,10 @@ unsigned TargetTransformInfo::getRegiste
return TTIImpl->getRegisterBitWidth(Vector);
}
+unsigned TargetTransformInfo::getLoadStoreVecRegBitWidth(unsigned AS) const {
+ return TTIImpl->getLoadStoreVecRegBitWidth(AS);
+}
+
unsigned TargetTransformInfo::getCacheLineSize() const {
return TTIImpl->getCacheLineSize();
}
More information about the llvm-commits
mailing list