summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.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/LLVMTargetMachine.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/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index d3d8a508292..617ed75c24f 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -79,8 +79,9 @@ LLVMTargetMachine::LLVMTargetMachine(const Target &T, StringRef Triple,
}
TargetIRAnalysis LLVMTargetMachine::getTargetIRAnalysis() {
- return TargetIRAnalysis(
- [this](Function &) { return TargetTransformInfo(BasicTTIImpl(this)); });
+ return TargetIRAnalysis([this](Function &F) {
+ return TargetTransformInfo(BasicTTIImpl(this, F));
+ });
}
/// addPassesToX helper drives creation and initialization of TargetPassConfig.
OpenPOWER on IntegriCloud