Index: llvm/trunk/tools/llvm-exegesis/lib/CMakeLists.txt =================================================================== --- llvm/trunk/tools/llvm-exegesis/lib/CMakeLists.txt +++ llvm/trunk/tools/llvm-exegesis/lib/CMakeLists.txt @@ -18,6 +18,7 @@ BenchmarkResult.cpp BenchmarkRunner.cpp Clustering.cpp + CodeTemplate.cpp Latency.cpp LlvmState.cpp MCInstrDescView.cpp Index: llvm/trunk/tools/llvm-exegesis/lib/CodeTemplate.h =================================================================== --- llvm/trunk/tools/llvm-exegesis/lib/CodeTemplate.h +++ llvm/trunk/tools/llvm-exegesis/lib/CodeTemplate.h @@ -0,0 +1,44 @@ +//===-- CodeTemplate.h ------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// A CodeTemplate is a set of InstructionBuilders that may not be fully +/// specified (i.e. some variables are not yet set). This allows the +/// BenchmarkRunner to instantiate it many times with specific values to study +/// their impact on instruction's performance. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TOOLS_LLVM_EXEGESIS_CODETEMPLATE_H +#define LLVM_TOOLS_LLVM_EXEGESIS_CODETEMPLATE_H + +#include "MCInstrDescView.h" + +namespace exegesis { + +struct CodeTemplate { + CodeTemplate() = default; + + CodeTemplate(CodeTemplate &&); // default + CodeTemplate &operator=(CodeTemplate &&); // default + CodeTemplate(const CodeTemplate &) = delete; + CodeTemplate &operator=(const CodeTemplate &) = delete; + + // Some information about how this template has been created. + std::string Info; + // The list of the instructions for this template. + std::vector Instructions; + // If the template uses the provided scratch memory, the register in which + // the pointer to this memory is passed in to the function. + unsigned ScratchSpacePointerInReg = 0; +}; + +} // namespace exegesis + +#endif // LLVM_TOOLS_LLVM_EXEGESIS_CODETEMPLATE_H Index: llvm/trunk/tools/llvm-exegesis/lib/CodeTemplate.cpp =================================================================== --- llvm/trunk/tools/llvm-exegesis/lib/CodeTemplate.cpp +++ llvm/trunk/tools/llvm-exegesis/lib/CodeTemplate.cpp @@ -0,0 +1,18 @@ +//===-- CodeTemplate.cpp ----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "CodeTemplate.h" + +namespace exegesis { + +CodeTemplate::CodeTemplate(CodeTemplate &&) = default; + +CodeTemplate &CodeTemplate::operator=(CodeTemplate &&) = default; + +} // namespace exegesis Index: llvm/trunk/tools/llvm-exegesis/lib/MCInstrDescView.h =================================================================== --- llvm/trunk/tools/llvm-exegesis/lib/MCInstrDescView.h +++ llvm/trunk/tools/llvm-exegesis/lib/MCInstrDescView.h @@ -111,27 +111,6 @@ llvm::SmallVector VariableValues; }; -// A CodeTemplate is a set of InstructionBuilders that may not be fully -// specified (i.e. some variables are not yet set). -// This allows the BenchmarkRunner to instantiate it many times with specific -// values to study their impact on instruction's performance. -struct CodeTemplate { - CodeTemplate() = default; - - CodeTemplate(CodeTemplate &&); // default - CodeTemplate &operator=(CodeTemplate &&); // default - CodeTemplate(const CodeTemplate &) = delete; - CodeTemplate &operator=(const CodeTemplate &) = delete; - - // Some information about how this template has been created. - std::string Info; - // The list of the instructions for this template. - std::vector Instructions; - // If the template uses the provided scratch memory, the register in which - // the pointer to this memory is passed in to the function. - unsigned ScratchSpacePointerInReg = 0; -}; - // Represents the assignment of a Register to an Operand. struct RegisterOperandAssignment { RegisterOperandAssignment(const Operand *Operand, llvm::MCPhysReg Reg) Index: llvm/trunk/tools/llvm-exegesis/lib/MCInstrDescView.cpp =================================================================== --- llvm/trunk/tools/llvm-exegesis/lib/MCInstrDescView.cpp +++ llvm/trunk/tools/llvm-exegesis/lib/MCInstrDescView.cpp @@ -159,10 +159,6 @@ return Result; } -CodeTemplate::CodeTemplate(CodeTemplate &&) = default; - -CodeTemplate &CodeTemplate::operator=(CodeTemplate &&) = default; - bool RegisterOperandAssignment:: operator==(const RegisterOperandAssignment &Other) const { return std::tie(Op, Reg) == std::tie(Other.Op, Other.Reg); Index: llvm/trunk/tools/llvm-exegesis/lib/SnippetGenerator.h =================================================================== --- llvm/trunk/tools/llvm-exegesis/lib/SnippetGenerator.h +++ llvm/trunk/tools/llvm-exegesis/lib/SnippetGenerator.h @@ -18,6 +18,7 @@ #include "Assembler.h" #include "BenchmarkCode.h" +#include "CodeTemplate.h" #include "LlvmState.h" #include "MCInstrDescView.h" #include "RegisterAliasing.h"