summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-02-01 14:01:15 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-02-01 14:01:15 +0000
commitc340ca839c083970e3ff0d123c771fe01e43c808 (patch)
treeecde5e58d22c8d4144cd54f992234a258ea8ee93 /llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
parent0ef5e3916667d586d4844ccef5adbe2e3579051f (diff)
downloadbcm5719-llvm-c340ca839c083970e3ff0d123c771fe01e43c808.tar.gz
bcm5719-llvm-c340ca839c083970e3ff0d123c771fe01e43c808.zip
[multiversion] Remove the cached TargetMachine pointer from the
intermediate TTI implementation template and instead query up to the derived class for both the TargetMachine and the TargetLowering. Most of the derived types had a TLI cached already and there is no need to store a less precisely typed target machine pointer. This will in turn make it much cleaner to look up the TLI via a per-function subtarget instead of the generic subtarget, and it will pave the way toward pulling the subtarget used for unroll preferences into the same form once we are *always* using the function to look up the correct subtarget. llvm-svn: 227737
Diffstat (limited to 'llvm/lib/CodeGen/BasicTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/BasicTargetTransformInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
index a9fe43c6605..e0334732fdc 100644
--- a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
+++ b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
@@ -33,4 +33,5 @@ cl::opt<unsigned>
cl::desc("Threshold for partial unrolling"),
cl::Hidden);
-BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM) : BaseT(TM) {}
+BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM)
+ : BaseT(TM), TM(TM), TLI(TM->getSubtargetImpl()->getTargetLowering()) {}
OpenPOWER on IntegriCloud