diff options
| author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-07-02 19:05:09 +0000 |
|---|---|---|
| committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-07-02 19:05:09 +0000 |
| commit | fd97494984071cbdf32432654d660b9cf4eca77a (patch) | |
| tree | cf66efa6181316ae97d8d86e83072f4b49453e3e /llvm/utils/TableGen | |
| parent | 0e15501fa71f46eb0059bd6c15b8be6e07ca924c (diff) | |
| download | bcm5719-llvm-fd97494984071cbdf32432654d660b9cf4eca77a.tar.gz bcm5719-llvm-fd97494984071cbdf32432654d660b9cf4eca77a.zip | |
[X86] Add phony registers for high halves of regs with low halves
Add registers still missing after r328016 (D43353):
- for bits 15-8 of SI, DI, BP, SP (*H), and R8-R15 (*BH),
- for bits 31-16 of R8-R15 (*WH).
Thanks to Craig Topper for pointing it out.
llvm-svn: 336134
Diffstat (limited to 'llvm/utils/TableGen')
| -rw-r--r-- | llvm/utils/TableGen/CodeGenRegisters.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenRegisters.cpp b/llvm/utils/TableGen/CodeGenRegisters.cpp index e05f9481012..b0d13b7d38f 100644 --- a/llvm/utils/TableGen/CodeGenRegisters.cpp +++ b/llvm/utils/TableGen/CodeGenRegisters.cpp @@ -388,13 +388,17 @@ CodeGenRegister::computeSubRegs(CodeGenRegBank &RegBank) { // user already specified. for (unsigned i = 0, e = ExplicitSubRegs.size(); i != e; ++i) { CodeGenRegister *SR = ExplicitSubRegs[i]; - if (!SR->CoveredBySubRegs || SR->ExplicitSubRegs.size() <= 1) + if (!SR->CoveredBySubRegs || SR->ExplicitSubRegs.size() <= 1 || + SR->Artificial) continue; // SR is composed of multiple sub-regs. Find their names in this register. SmallVector<CodeGenSubRegIndex*, 8> Parts; - for (unsigned j = 0, e = SR->ExplicitSubRegs.size(); j != e; ++j) - Parts.push_back(getSubRegIndex(SR->ExplicitSubRegs[j])); + for (unsigned j = 0, e = SR->ExplicitSubRegs.size(); j != e; ++j) { + CodeGenSubRegIndex &I = *SR->ExplicitSubRegIndices[j]; + if (!I.Artificial) + Parts.push_back(getSubRegIndex(SR->ExplicitSubRegs[j])); + } // Offer this as an existing spelling for the concatenation of Parts. CodeGenSubRegIndex &Idx = *ExplicitSubRegIndices[i]; @@ -2180,6 +2184,8 @@ void CodeGenRegBank::inferMatchingSuperRegClass(CodeGenRegisterClass *RC, for (auto I = FirstSubRegRC, E = std::prev(RegClasses.end()); I != std::next(E); ++I) { CodeGenRegisterClass &SubRC = *I; + if (SubRC.Artificial) + continue; // Topological shortcut: SubRC members have the wrong shape. if (!TopoSigs.anyCommon(SubRC.getTopoSigs())) continue; |

