LLVM
8.0.1
include
llvm
MCA
Context.h
Go to the documentation of this file.
1
//===---------------------------- Context.h ---------------------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
/// \file
10
///
11
/// This file defines a class for holding ownership of various simulated
12
/// hardware units. A Context also provides a utility routine for constructing
13
/// a default out-of-order pipeline with fetch, dispatch, execute, and retire
14
/// stages.
15
///
16
//===----------------------------------------------------------------------===//
17
18
#ifndef LLVM_MCA_CONTEXT_H
19
#define LLVM_MCA_CONTEXT_H
20
21
#include "
llvm/MC/MCRegisterInfo.h
"
22
#include "
llvm/MC/MCSubtargetInfo.h
"
23
#include "
llvm/MCA/HardwareUnits/HardwareUnit.h
"
24
#include "
llvm/MCA/InstrBuilder.h
"
25
#include "
llvm/MCA/Pipeline.h
"
26
#include "
llvm/MCA/SourceMgr.h
"
27
#include <memory>
28
29
namespace
llvm
{
30
namespace
mca {
31
32
/// This is a convenience struct to hold the parameters necessary for creating
33
/// the pre-built "default" out-of-order pipeline.
34
struct
PipelineOptions
{
35
PipelineOptions
(
unsigned
DW,
unsigned
RFS,
unsigned
LQS,
unsigned
SQS,
36
bool
NoAlias
)
37
:
DispatchWidth
(DW),
RegisterFileSize
(RFS),
LoadQueueSize
(LQS),
38
StoreQueueSize
(SQS),
AssumeNoAlias
(NoAlias) {}
39
unsigned
DispatchWidth
;
40
unsigned
RegisterFileSize
;
41
unsigned
LoadQueueSize
;
42
unsigned
StoreQueueSize
;
43
bool
AssumeNoAlias
;
44
};
45
46
class
Context
{
47
SmallVector<std::unique_ptr<HardwareUnit>
, 4> Hardware;
48
const
MCRegisterInfo
&
MRI
;
49
const
MCSubtargetInfo
&STI;
50
51
public
:
52
Context
(
const
MCRegisterInfo
&R,
const
MCSubtargetInfo
&S) : MRI(R), STI(S) {}
53
Context
(
const
Context
&
C
) =
delete
;
54
Context
&operator=(
const
Context
&C) =
delete
;
55
56
void
addHardwareUnit
(std::unique_ptr<HardwareUnit>
H
) {
57
Hardware.
push_back
(std::move(H));
58
}
59
60
/// Construct a basic pipeline for simulating an out-of-order pipeline.
61
/// This pipeline consists of Fetch, Dispatch, Execute, and Retire stages.
62
std::unique_ptr<Pipeline> createDefaultPipeline(
const
PipelineOptions
&Opts,
63
InstrBuilder
&IB,
64
SourceMgr
&
SrcMgr
);
65
};
66
67
}
// namespace mca
68
}
// namespace llvm
69
#endif // LLVM_MCA_CONTEXT_H
C
uint64_t CallInst * C
Definition:
NVVMIntrRange.cpp:67
llvm::mca::PipelineOptions::StoreQueueSize
unsigned StoreQueueSize
Definition:
Context.h:42
MCSubtargetInfo.h
llvm::mca::Context::addHardwareUnit
void addHardwareUnit(std::unique_ptr< HardwareUnit > H)
Definition:
Context.h:56
Context
LLVMContext & Context
Definition:
NVVMIntrRange.cpp:72
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::SmallVectorTemplateBase< T >::push_back
void push_back(const T &Elt)
Definition:
SmallVector.h:218
llvm::SrcMgr
SourceMgr SrcMgr
Definition:
Error.cpp:24
llvm::NoAlias
The two locations do not alias at all.
Definition:
AliasAnalysis.h:84
llvm::mca::InstrBuilder
A builder class that knows how to construct Instruction objects.
Definition:
InstrBuilder.h:39
llvm::mca::PipelineOptions
This is a convenience struct to hold the parameters necessary for creating the pre-built "default" ou...
Definition:
Context.h:34
Pipeline.h
This file implements an ordered container of stages that simulate the pipeline of a hardware backend...
llvm::mca::PipelineOptions::RegisterFileSize
unsigned RegisterFileSize
Definition:
Context.h:40
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition:
MCRegisterInfo.h:129
MRI
unsigned const MachineRegisterInfo * MRI
Definition:
AArch64AdvSIMDScalarPass.cpp:106
llvm::mca::PipelineOptions::AssumeNoAlias
bool AssumeNoAlias
Definition:
Context.h:43
llvm::mca::PipelineOptions::LoadQueueSize
unsigned LoadQueueSize
Definition:
Context.h:41
H
#define H(x, y, z)
Definition:
MD5.cpp:57
HardwareUnit.h
This file defines a base class for describing a simulated hardware unit.
llvm::mca::PipelineOptions::DispatchWidth
unsigned DispatchWidth
Definition:
Context.h:39
MCRegisterInfo.h
llvm::mca::PipelineOptions::PipelineOptions
PipelineOptions(unsigned DW, unsigned RFS, unsigned LQS, unsigned SQS, bool NoAlias)
Definition:
Context.h:35
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition:
SmallVector.h:847
llvm::mca::Context
Definition:
Context.h:46
SourceMgr.h
This file implements class SourceMgr.
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition:
MCSubtargetInfo.h:36
InstrBuilder.h
A builder class for instructions that are statically analyzed by llvm-mca.
llvm::mca::SourceMgr
Definition:
SourceMgr.h:28
llvm::mca::Context::Context
Context(const MCRegisterInfo &R, const MCSubtargetInfo &S)
Definition:
Context.h:52
Generated on Sun Dec 20 2020 13:53:32 for LLVM by
1.8.13