diff options
author | Clement Courbet <courbet@google.com> | 2018-06-25 13:44:27 +0000 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2018-06-25 13:44:27 +0000 |
commit | 14a520d8321af22e45c2c78a038d69a7ff4a59b4 (patch) | |
tree | c9dacd7ce0f9bea31770bd31c171d10a4cb4f91c /tools/llvm-exegesis | |
parent | 0c43400bbd50dfa998b848e506c4aba102825eaa (diff) |
[llvm-exegesis][NFC] Remove unnecessary member variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-exegesis')
-rw-r--r-- | tools/llvm-exegesis/lib/BenchmarkRunner.cpp | 5 | ||||
-rw-r--r-- | tools/llvm-exegesis/lib/BenchmarkRunner.h | 2 | ||||
-rw-r--r-- | tools/llvm-exegesis/lib/Latency.cpp | 8 | ||||
-rw-r--r-- | tools/llvm-exegesis/lib/Uops.cpp | 6 |
4 files changed, 9 insertions, 12 deletions
diff --git a/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/tools/llvm-exegesis/lib/BenchmarkRunner.cpp index 94b24732f6f..5223fbac335 100644 --- a/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -29,9 +29,8 @@ BenchmarkFailure::BenchmarkFailure(const llvm::Twine &S) BenchmarkRunner::InstructionFilter::~InstructionFilter() = default; BenchmarkRunner::BenchmarkRunner(const LLVMState &State) - : State(State), MCInstrInfo(State.getInstrInfo()), - MCRegisterInfo(State.getRegInfo()), - RATC(MCRegisterInfo, getFunctionReservedRegs(State.getTargetMachine())) {} + : State(State), + RATC(State.getRegInfo(), getFunctionReservedRegs(State.getTargetMachine())) {} BenchmarkRunner::~BenchmarkRunner() = default; diff --git a/tools/llvm-exegesis/lib/BenchmarkRunner.h b/tools/llvm-exegesis/lib/BenchmarkRunner.h index 4e8ba502b9b..6d1da9e4ba7 100644 --- a/tools/llvm-exegesis/lib/BenchmarkRunner.h +++ b/tools/llvm-exegesis/lib/BenchmarkRunner.h @@ -80,8 +80,6 @@ public: protected: const LLVMState &State; - const llvm::MCInstrInfo &MCInstrInfo; - const llvm::MCRegisterInfo &MCRegisterInfo; const RegisterAliasingTrackerCache RATC; private: diff --git a/tools/llvm-exegesis/lib/Latency.cpp b/tools/llvm-exegesis/lib/Latency.cpp index a221323734f..3cc0d85be8b 100644 --- a/tools/llvm-exegesis/lib/Latency.cpp +++ b/tools/llvm-exegesis/lib/Latency.cpp @@ -72,13 +72,13 @@ LatencyBenchmarkRunner::generateTwoInstructionPrototype( const Instruction &Instr, const AliasingConfigurations &SelfAliasing) const { std::vector<unsigned> Opcodes; - Opcodes.resize(MCInstrInfo.getNumOpcodes()); + Opcodes.resize(State.getInstrInfo().getNumOpcodes()); std::iota(Opcodes.begin(), Opcodes.end(), 0U); std::shuffle(Opcodes.begin(), Opcodes.end(), randomGenerator()); for (const unsigned OtherOpcode : Opcodes) { if (OtherOpcode == Instr.Description->Opcode) continue; - const auto &OtherInstrDesc = MCInstrInfo.get(OtherOpcode); + const auto &OtherInstrDesc = State.getInstrInfo().get(OtherOpcode); if (auto E = isInfeasible(OtherInstrDesc)) { llvm::consumeError(std::move(E)); continue; @@ -96,7 +96,7 @@ LatencyBenchmarkRunner::generateTwoInstructionPrototype( setRandomAliasing(Back, OtherII, ThisII); SnippetPrototype Prototype; Prototype.Explanation = llvm::formatv("creating cycle through {0}.", - MCInstrInfo.getName(OtherOpcode)); + State.getInstrInfo().getName(OtherOpcode)); Prototype.Snippet.push_back(std::move(ThisII)); Prototype.Snippet.push_back(std::move(OtherII)); return std::move(Prototype); @@ -107,7 +107,7 @@ LatencyBenchmarkRunner::generateTwoInstructionPrototype( llvm::Expected<SnippetPrototype> LatencyBenchmarkRunner::generatePrototype(unsigned Opcode) const { - const auto &InstrDesc = MCInstrInfo.get(Opcode); + const auto &InstrDesc = State.getInstrInfo().get(Opcode); if (auto E = isInfeasible(InstrDesc)) return std::move(E); const Instruction Instr(InstrDesc, RATC); diff --git a/tools/llvm-exegesis/lib/Uops.cpp b/tools/llvm-exegesis/lib/Uops.cpp index 349f5f4eaa4..677a9d3a104 100644 --- a/tools/llvm-exegesis/lib/Uops.cpp +++ b/tools/llvm-exegesis/lib/Uops.cpp @@ -139,7 +139,7 @@ InstructionBenchmark::ModeE UopsBenchmarkRunner::getMode() const { llvm::Expected<SnippetPrototype> UopsBenchmarkRunner::generatePrototype(unsigned Opcode) const { - const auto &InstrDesc = MCInstrInfo.get(Opcode); + const auto &InstrDesc = State.getInstrInfo().get(Opcode); if (auto E = isInfeasible(InstrDesc)) return std::move(E); const Instruction Instr(InstrDesc, RATC); @@ -179,7 +179,7 @@ UopsBenchmarkRunner::generatePrototype(unsigned Opcode) const { } InstructionInstance II(Instr); // No tied variables, we pick random values for defs. - llvm::BitVector Defs(MCRegisterInfo.getNumRegs()); + llvm::BitVector Defs(State.getRegInfo().getNumRegs()); for (const auto &Op : Instr.Operands) { if (Op.Tracker && Op.IsExplicit && Op.IsDef) { auto PossibleRegisters = Op.Tracker->sourceBits(); @@ -191,7 +191,7 @@ UopsBenchmarkRunner::generatePrototype(unsigned Opcode) const { } } // And pick random use values that are not reserved and don't alias with defs. - const auto DefAliases = getAliasedBits(MCRegisterInfo, Defs); + const auto DefAliases = getAliasedBits(State.getRegInfo(), Defs); for (const auto &Op : Instr.Operands) { if (Op.Tracker && Op.IsExplicit && !Op.IsDef) { auto PossibleRegisters = Op.Tracker->sourceBits(); |