mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[llvm-exegesis][NFC] Move CodeTemplate to it's own file.
Summary: This is is preparation of exploring value ranges. Reviewers: courbet Reviewed By: courbet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D52542 llvm-svn: 343098
This commit is contained in:
parent
cb76b5c846
commit
8cb562eed8
@ -18,6 +18,7 @@ add_library(LLVMExegesis
|
|||||||
BenchmarkResult.cpp
|
BenchmarkResult.cpp
|
||||||
BenchmarkRunner.cpp
|
BenchmarkRunner.cpp
|
||||||
Clustering.cpp
|
Clustering.cpp
|
||||||
|
CodeTemplate.cpp
|
||||||
Latency.cpp
|
Latency.cpp
|
||||||
LlvmState.cpp
|
LlvmState.cpp
|
||||||
MCInstrDescView.cpp
|
MCInstrDescView.cpp
|
||||||
|
18
tools/llvm-exegesis/lib/CodeTemplate.cpp
Normal file
18
tools/llvm-exegesis/lib/CodeTemplate.cpp
Normal file
@ -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
|
44
tools/llvm-exegesis/lib/CodeTemplate.h
Normal file
44
tools/llvm-exegesis/lib/CodeTemplate.h
Normal file
@ -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<InstructionBuilder> 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
|
@ -159,10 +159,6 @@ llvm::MCInst InstructionBuilder::build() const {
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeTemplate::CodeTemplate(CodeTemplate &&) = default;
|
|
||||||
|
|
||||||
CodeTemplate &CodeTemplate::operator=(CodeTemplate &&) = default;
|
|
||||||
|
|
||||||
bool RegisterOperandAssignment::
|
bool RegisterOperandAssignment::
|
||||||
operator==(const RegisterOperandAssignment &Other) const {
|
operator==(const RegisterOperandAssignment &Other) const {
|
||||||
return std::tie(Op, Reg) == std::tie(Other.Op, Other.Reg);
|
return std::tie(Op, Reg) == std::tie(Other.Op, Other.Reg);
|
||||||
|
@ -111,27 +111,6 @@ struct InstructionBuilder {
|
|||||||
llvm::SmallVector<llvm::MCOperand, 4> VariableValues;
|
llvm::SmallVector<llvm::MCOperand, 4> 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<InstructionBuilder> 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.
|
// Represents the assignment of a Register to an Operand.
|
||||||
struct RegisterOperandAssignment {
|
struct RegisterOperandAssignment {
|
||||||
RegisterOperandAssignment(const Operand *Operand, llvm::MCPhysReg Reg)
|
RegisterOperandAssignment(const Operand *Operand, llvm::MCPhysReg Reg)
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "Assembler.h"
|
#include "Assembler.h"
|
||||||
#include "BenchmarkCode.h"
|
#include "BenchmarkCode.h"
|
||||||
|
#include "CodeTemplate.h"
|
||||||
#include "LlvmState.h"
|
#include "LlvmState.h"
|
||||||
#include "MCInstrDescView.h"
|
#include "MCInstrDescView.h"
|
||||||
#include "RegisterAliasing.h"
|
#include "RegisterAliasing.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user