summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2018-10-24 11:55:06 +0000
committerGuillaume Chatelet <gchatelet@google.com>2018-10-24 11:55:06 +0000
commitda11b85606f532a1b4aac96d5f9c92eded60e568 (patch)
tree33e71f89ba50ac382c55f97db69b5194a9325df1 /llvm/unittests/tools
parent083addf75192ff07eccd002eceeeacd085054217 (diff)
downloadbcm5719-llvm-da11b85606f532a1b4aac96d5f9c92eded60e568.tar.gz
bcm5719-llvm-da11b85606f532a1b4aac96d5f9c92eded60e568.zip
[llvm-exegesis] Implements a cache of Instruction objects.
llvm-svn: 345130
Diffstat (limited to 'llvm/unittests/tools')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
index 04517359d8a..1689defded8 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
+++ b/llvm/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:
OpenPOWER on IntegriCloud