diff options
| author | Andrew Trick <atrick@apple.com> | 2013-03-01 23:31:26 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2013-03-01 23:31:26 +0000 |
| commit | 3821d9d028a32c3e77d1517d2c648bc701dd8604 (patch) | |
| tree | f614eb6f66e66eb9e0aceb9bec070cd4304fae4e /llvm/utils | |
| parent | 687d1d33f475d747df38c6f4917b58cfdf54eac4 (diff) | |
| download | bcm5719-llvm-3821d9d028a32c3e77d1517d2c648bc701dd8604.tar.gz bcm5719-llvm-3821d9d028a32c3e77d1517d2c648bc701dd8604.zip | |
MIsched machine model: tablegen subtarget emitter improvement.
Fix the way resources are counted. I'm taking some time to cleanup the
way MachineScheduler handles in-order machine resources. Eventually
we'll need more PPC/Atom test cases in tree.
llvm-svn: 176390
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/TableGen/SubtargetEmitter.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp index fc8d00dd83f..93eef868ea0 100644 --- a/llvm/utils/TableGen/SubtargetEmitter.cpp +++ b/llvm/utils/TableGen/SubtargetEmitter.cpp @@ -893,7 +893,20 @@ void SubtargetEmitter::GenSchedClassTables(const CodeGenProcModel &ProcModel, WPREntry.Cycles = Cycles[PRIdx]; else WPREntry.Cycles = 1; - WriteProcResources.push_back(WPREntry); + // If this resource is already used in this sequence, add the current + // entry's cycles so that the same resource appears to be used + // serially, rather than multiple parallel uses. This is important for + // in-order machine where the resource consumption is a hazard. + unsigned WPRIdx = 0, WPREnd = WriteProcResources.size(); + for( ; WPRIdx != WPREnd; ++WPRIdx) { + if (WriteProcResources[WPRIdx].ProcResourceIdx + == WPREntry.ProcResourceIdx) { + WriteProcResources[WPRIdx].Cycles += WPREntry.Cycles; + break; + } + } + if (WPRIdx == WPREnd) + WriteProcResources.push_back(WPREntry); } } WriteLatencies.push_back(WLEntry); |

