aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetTransformImpl.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-10-24 17:22:41 +0000
committerNadav Rotem <nrotem@apple.com>2012-10-24 17:22:41 +0000
commit2289f2c932542a0e193ef562d1517602c3c94faf (patch)
tree82d9a63a3eb07ca125964c0ff48a8ba118718340 /llvm/lib/Target/TargetTransformImpl.cpp
parent91c826620079bad984959aae511bf32241f6e4b0 (diff)
downloadllvm-2289f2c932542a0e193ef562d1517602c3c94faf.zip
llvm-2289f2c932542a0e193ef562d1517602c3c94faf.tar.gz
llvm-2289f2c932542a0e193ef562d1517602c3c94faf.tar.bz2
Implement a basic VectorTargetTransformInfo interface to be used by the loop and bb vectorizers for modeling the cost of instructions.
llvm-svn: 166593
Diffstat (limited to 'llvm/lib/Target/TargetTransformImpl.cpp')
-rw-r--r--llvm/lib/Target/TargetTransformImpl.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetTransformImpl.cpp b/llvm/lib/Target/TargetTransformImpl.cpp
index 1cb5eda..cee736b 100644
--- a/llvm/lib/Target/TargetTransformImpl.cpp
+++ b/llvm/lib/Target/TargetTransformImpl.cpp
@@ -12,6 +12,12 @@
using namespace llvm;
+//===----------------------------------------------------------------------===//
+//
+// Calls used by scalar transformations.
+//
+//===----------------------------------------------------------------------===//
+
bool ScalarTargetTransformImpl::isLegalAddImmediate(int64_t imm) const {
return TLI->isLegalAddImmediate(imm);
}
@@ -41,3 +47,27 @@ unsigned ScalarTargetTransformImpl::getJumpBufAlignment() const {
unsigned ScalarTargetTransformImpl::getJumpBufSize() const {
return TLI->getJumpBufSize();
}
+
+//===----------------------------------------------------------------------===//
+//
+// Calls used by the vectorizers.
+//
+//===----------------------------------------------------------------------===//
+
+unsigned
+VectorTargetTransformImpl::getInstrCost(unsigned Opcode, Type *Ty1,
+ Type *Ty2) const {
+ return 1;
+}
+
+unsigned
+VectorTargetTransformImpl::getBroadcastCost(Type *Tp) const {
+ return 1;
+}
+
+unsigned
+VectorTargetTransformImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
+ unsigned Alignment,
+ unsigned AddressSpace) const {
+ return 1;
+}