summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-02-01 14:22:17 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-02-01 14:22:17 +0000
commitc956ab66037e3b0e6b3a039728348de1db1c4ad6 (patch)
treecb1ce486bb5c35458d300ea5f52cf6972d611bc2 /llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
parentc340ca839c083970e3ff0d123c771fe01e43c808 (diff)
downloadbcm5719-llvm-c956ab66037e3b0e6b3a039728348de1db1c4ad6.tar.gz
bcm5719-llvm-c956ab66037e3b0e6b3a039728348de1db1c4ad6.zip
[multiversion] Switch the TTI queries from TargetMachine to Subtarget
now that we have a correct and cached subtarget specific to the function. Also, finish providing a cached per-function subtarget in the core LLVMTargetMachine -- that layer hadn't switched over yet. The only use of the TargetMachine was to re-lookup a subtarget for a particular function to work around the fact that TTI was immutable. Now that it is per-function and we haved a cached subtarget, use it. This still leaves a few interfaces with real warts on them where we were passing Function objects through the TTI interface. I'll remove these and clean their usage up in subsequent commits now that this isn't necessary. llvm-svn: 227738
Diffstat (limited to 'llvm/lib/CodeGen/BasicTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/BasicTargetTransformInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
index e0334732fdc..2496d215cc0 100644
--- a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
+++ b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp
@@ -33,5 +33,5 @@ cl::opt<unsigned>
cl::desc("Threshold for partial unrolling"),
cl::Hidden);
-BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM)
- : BaseT(TM), TM(TM), TLI(TM->getSubtargetImpl()->getTargetLowering()) {}
+BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, Function &F)
+ : BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {}
OpenPOWER on IntegriCloud