summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-02-01 12:26:09 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-02-01 12:26:09 +0000
commit276f40540766ad0cfadbf744e0eb58499f60238a (patch)
treec00af272c46f98cb5f9fbf5956484ea6f0c384f9 /tools
parentbaceda736e85ecd0e85127710ed2f91f139e07d5 (diff)
[multiversion] Implement the old pass manager's TTI wrapper pass in
terms of the new pass manager's TargetIRAnalysis. Yep, this is one of the nicer bits of the new pass manager's design. Passes can in many cases operate in a vacuum and so we can just nest things when convenient. This is particularly convenient here as I can now consolidate all of the TargetMachine logic on this analysis. The most important change here is that this pushes the function we need TTI for all the way into the TargetMachine, and re-creates the TTI object for each function rather than re-using it for each function. We're now prepared to teach the targets to produce function-specific TTI objects with specific subtargets cached, etc. One piece of feedback I'd love here is whether its worth renaming any of this stuff. None of the names really seem that awesome to me at this point, but TargetTransformInfoWrapperPass is particularly ... odd. TargetIRAnalysisWrapper might make more sense. I would want to do that rename separately anyways, but let me know what you think. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/opt/opt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index af2cdd82460..00337ded99a 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -427,8 +427,8 @@ int main(int argc, char **argv) {
Passes.add(new DataLayoutPass());
// Add internal analysis passes from the target machine.
- Passes.add(createTargetTransformInfoWrapperPass(
- TM ? TM->getTTI() : TargetTransformInfo(DL)));
+ Passes.add(createTargetTransformInfoWrapperPass(TM ? TM->getTargetIRAnalysis()
+ : TargetIRAnalysis()));
std::unique_ptr<FunctionPassManager> FPasses;
if (OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz || OptLevelO3) {
@@ -436,7 +436,7 @@ int main(int argc, char **argv) {
if (DL)
FPasses->add(new DataLayoutPass());
FPasses->add(createTargetTransformInfoWrapperPass(
- TM ? TM->getTTI() : TargetTransformInfo(DL)));
+ TM ? TM->getTargetIRAnalysis() : TargetIRAnalysis()));
}
if (PrintBreakpoints) {