mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[PM] Port TTI to the new pass manager, introducing a TargetIRAnalysis to
produce it. This adds a function to the TargetMachine that produces this analysis via a callback for each function. This in turn faves the way to produce a *different* TTI per-function with the correct subtarget cached. I've also done the necessary wiring in the opt tool to thread the target machine down and make it available to the pass registry so that we can construct this analysis from a target machine when available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227721 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -172,6 +172,13 @@ void TargetMachine::setDataSections(bool V) {
|
||||
Options.DataSections = 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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user