diff options
| author | Guillaume Chatelet <gchatelet@google.com> | 2018-10-10 14:22:48 +0000 |
|---|---|---|
| committer | Guillaume Chatelet <gchatelet@google.com> | 2018-10-10 14:22:48 +0000 |
| commit | ee9c2a17b823fe9c375002b4bec9ce989f5c66f5 (patch) | |
| tree | ed700f70d8ea65a7b4fc90d34d9b5e406a3e5cbd /llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp | |
| parent | 07acc992dc39edfccc5a4b773c3dcf8a5bf6d893 (diff) | |
| download | bcm5719-llvm-ee9c2a17b823fe9c375002b4bec9ce989f5c66f5.tar.gz bcm5719-llvm-ee9c2a17b823fe9c375002b4bec9ce989f5c66f5.zip | |
[llvm-exegesis][NFC] Code simplification
Summary: Simplify code by having LLVMState hold the RegisterAliasingTrackerCache.
Reviewers: courbet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D53078
llvm-svn: 344143
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp')
| -rw-r--r-- | llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp b/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp index 75d85873146..d54f3ca2a45 100644 --- a/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp +++ b/llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp @@ -87,24 +87,24 @@ const llvm::MCOperandInfo &Operand::getExplicitOperandInfo() const { return *Info; } -Instruction::Instruction(const llvm::MCInstrDesc &MCInstrDesc, - const RegisterAliasingTrackerCache &RATC) - : Description(&MCInstrDesc) { +Instruction::Instruction(const LLVMState &State, unsigned Opcode) + : Description(&State.getInstrInfo().get(Opcode)) { + const auto &RATC = State.getRATC(); unsigned OpIndex = 0; - for (; OpIndex < MCInstrDesc.getNumOperands(); ++OpIndex) { - const auto &OpInfo = MCInstrDesc.opInfo_begin()[OpIndex]; + for (; OpIndex < Description->getNumOperands(); ++OpIndex) { + const auto &OpInfo = Description->opInfo_begin()[OpIndex]; Operand Operand; Operand.Index = OpIndex; - Operand.IsDef = (OpIndex < MCInstrDesc.getNumDefs()); + Operand.IsDef = (OpIndex < Description->getNumDefs()); // TODO(gchatelet): Handle isLookupPtrRegClass. if (OpInfo.RegClass >= 0) Operand.Tracker = &RATC.getRegisterClass(OpInfo.RegClass); Operand.TiedToIndex = - MCInstrDesc.getOperandConstraint(OpIndex, llvm::MCOI::TIED_TO); + Description->getOperandConstraint(OpIndex, llvm::MCOI::TIED_TO); Operand.Info = &OpInfo; Operands.push_back(Operand); } - for (const llvm::MCPhysReg *MCPhysReg = MCInstrDesc.getImplicitDefs(); + for (const llvm::MCPhysReg *MCPhysReg = Description->getImplicitDefs(); MCPhysReg && *MCPhysReg; ++MCPhysReg, ++OpIndex) { Operand Operand; Operand.Index = OpIndex; @@ -113,7 +113,7 @@ Instruction::Instruction(const llvm::MCInstrDesc &MCInstrDesc, Operand.ImplicitReg = MCPhysReg; Operands.push_back(Operand); } - for (const llvm::MCPhysReg *MCPhysReg = MCInstrDesc.getImplicitUses(); + for (const llvm::MCPhysReg *MCPhysReg = Description->getImplicitUses(); MCPhysReg && *MCPhysReg; ++MCPhysReg, ++OpIndex) { Operand Operand; Operand.Index = OpIndex; |

