diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-02-01 13:20:00 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-02-01 13:20:00 +0000 |
commit | 8b04c0d26a21c724a82aa1c2ac7ab9c0b90b5f7c (patch) | |
tree | 0c32bcfd2e7d505cbab40af3abc8279d3540b3ba /llvm/lib/Target/Mips/MipsTargetMachine.cpp | |
parent | ee642690ea9052e57cf09a798dda465d0c11db7f (diff) | |
download | bcm5719-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/Mips/MipsTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index 54b57dd76e3..0fd3a14b7cf 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -238,18 +238,17 @@ void MipsPassConfig::addPreRegAlloc() { addPass(createMipsOptimizePICCallPass(getMipsTargetMachine())); } -TargetTransformInfo MipsTargetMachine::getTTI() { - if (Subtarget->allowMixed16_32()) { - DEBUG(errs() << "No Target Transform Info Pass Added\n"); - //FIXME: The Basic Target Transform Info - // pass needs to become a function pass instead of - // being an immutable pass and then this method as it exists now - // would be unnecessary. - return TargetTransformInfo(getDataLayout()); - } - - DEBUG(errs() << "Target Transform Info Pass Added\n"); - return LLVMTargetMachine::getTTI(); +TargetIRAnalysis MipsTargetMachine::getTargetIRAnalysis() { + return TargetIRAnalysis([this](Function &F) { + if (Subtarget->allowMixed16_32()) { + DEBUG(errs() << "No Target Transform Info Pass Added\n"); + // FIXME: This is no longer necessary as the TTI returned is per-function. + return TargetTransformInfo(getDataLayout()); + } + + DEBUG(errs() << "Target Transform Info Pass Added\n"); + return TargetTransformInfo(BasicTTIImpl(this)); + }); } // Implemented by targets that want to run passes immediately before |