summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-02-01 13:20:00 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-02-01 13:20:00 +0000
commit8b04c0d26a21c724a82aa1c2ac7ab9c0b90b5f7c (patch)
tree0c32bcfd2e7d505cbab40af3abc8279d3540b3ba /llvm/lib/Target/TargetMachine.cpp
parentee642690ea9052e57cf09a798dda465d0c11db7f (diff)
downloadbcm5719-llvm-8b04c0d26a21c724a82aa1c2ac7ab9c0b90b5f7c.tar.gz
bcm5719-llvm-8b04c0d26a21c724a82aa1c2ac7ab9c0b90b5f7c.zip
[multiversion] Switch all of the targets over to use the
TargetIRAnalysis access path directly rather than implementing getTTI. This even removes getTTI from the interface. It's more efficient for each target to just register a precise callback that creates their specific TTI. As part of this, all of the targets which are building their subtargets individually per-function now build their TTI instance with the function and thus look up the correct subtarget and cache it. NVPTX, R600, and XCore currently don't leverage this functionality, but its trivial for them to add it now. llvm-svn: 227735
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 1e5bfb24729..ef0341dc917 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -173,14 +173,8 @@ void TargetMachine::setDataSections(bool V) {
}
TargetIRAnalysis TargetMachine::getTargetIRAnalysis() {
- // While targets are free to just override getTTI and rely on this analysis,
- // it would be more efficient to override and provide an analysis that could
- // directly construct that target's TTI without the virtual call.
- return TargetIRAnalysis([this](Function &) { return getTTI(); });
-}
-
-TargetTransformInfo TargetMachine::getTTI() {
- return TargetTransformInfo(getDataLayout());
+ return TargetIRAnalysis(
+ [this](Function &) { return TargetTransformInfo(getDataLayout()); });
}
static bool canUsePrivateLabel(const MCAsmInfo &AsmInfo,
OpenPOWER on IntegriCloud