diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2018-10-24 11:55:06 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2018-10-24 11:55:06 +0000 |
commit | 2191c153b0abf38d61f5b1bf3ec28873df0ef6f0 (patch) | |
tree | 3a579b6c97b37da818c6f6fa97df63addb3b13c6 /unittests | |
parent | 8f55d0922bba1f85b3f0fa087a317eade3249ae8 (diff) |
[llvm-exegesis] Implements a cache of Instruction objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp b/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp index 04517359d8a..1689defded8 100644 --- a/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp +++ b/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp @@ -61,7 +61,7 @@ protected: std::vector<CodeTemplate> checkAndGetCodeTemplates(unsigned Opcode) { randomGenerator().seed(0); // Initialize seed. - const Instruction Instr(State, Opcode); + const Instruction &Instr = State.getIC().getInstr(Opcode); auto CodeTemplateOrError = Generator.generateCodeTemplates(Instr); EXPECT_FALSE(CodeTemplateOrError.takeError()); // Valid configuration. return std::move(CodeTemplateOrError.get()); @@ -341,7 +341,7 @@ TEST_F(UopsSnippetGeneratorTest, MemoryUse_Movsb) { // - hasAliasingImplicitRegisters (execution is always serial) // - hasAliasingRegisters const unsigned Opcode = llvm::X86::MOVSB; - const Instruction Instr(State, Opcode); + const Instruction &Instr = State.getIC().getInstr(Opcode); auto Error = Generator.generateCodeTemplates(Instr).takeError(); EXPECT_TRUE((bool)Error); llvm::consumeError(std::move(Error)); @@ -352,7 +352,7 @@ public: FakeSnippetGenerator(const LLVMState &State) : SnippetGenerator(State) {} Instruction createInstruction(unsigned Opcode) { - return Instruction(State, Opcode); + return State.getIC().getInstr(Opcode); } private: |