aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/SubtargetEmitter.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-03-26 21:36:39 +0000
committerAndrew Trick <atrick@apple.com>2013-03-26 21:36:39 +0000
commite97978f94ca53f22cb01bac1ef3c268f89f68e1d (patch)
treeabbeb9b636712f9f8f81d38c83efaa1aa6b1e7d8 /llvm/utils/TableGen/SubtargetEmitter.cpp
parent1fa2f945ea6e8efef2e9f73833af5550f1b8a1ad (diff)
downloadllvm-e97978f94ca53f22cb01bac1ef3c268f89f68e1d.zip
llvm-e97978f94ca53f22cb01bac1ef3c268f89f68e1d.tar.gz
llvm-e97978f94ca53f22cb01bac1ef3c268f89f68e1d.tar.bz2
TableGen SubtargetEmitter fix to allow A9 and Swift to coexist.
Allow variants to be defined only for some processors on a target. llvm-svn: 178074
Diffstat (limited to 'llvm/utils/TableGen/SubtargetEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/SubtargetEmitter.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp
index 5fb811e..98892e1 100644
--- a/llvm/utils/TableGen/SubtargetEmitter.cpp
+++ b/llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -850,7 +850,22 @@ void SubtargetEmitter::GenSchedClassTables(const CodeGenProcModel &ProcModel,
SCDesc.ReadAdvanceIdx = 0;
// A Variant SchedClass has no resources of its own.
- if (!SCI->Transitions.empty()) {
+ bool HasVariants = false;
+ for (std::vector<CodeGenSchedTransition>::const_iterator
+ TI = SCI->Transitions.begin(), TE = SCI->Transitions.end();
+ TI != TE; ++TI) {
+ if (TI->ProcIndices[0] == 0) {
+ HasVariants = true;
+ break;
+ }
+ IdxIter PIPos = std::find(TI->ProcIndices.begin(),
+ TI->ProcIndices.end(), ProcModel.Index);
+ if (PIPos != TI->ProcIndices.end()) {
+ HasVariants = true;
+ break;
+ }
+ }
+ if (HasVariants) {
SCDesc.NumMicroOps = MCSchedClassDesc::VariantNumMicroOps;
continue;
}