LLVM: include/llvm/MCA/Support.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_MCA_SUPPORT_H

15#define LLVM_MCA_SUPPORT_H

16

23

24namespace llvm {

25namespace mca {

26

27template

29public:

30 static char ID;

33

36

38

42};

43

45

46

47

48

49

50

51

53 unsigned Numerator, Denominator;

54

55public:

58 : Numerator(Cycles), Denominator(ResourceUnits) {}

59

60 operator double() const {

61 assert(Denominator && "Invalid denominator (must be non-zero).");

62 return (Denominator == 1) ? Numerator : (double)Numerator / Denominator;

63 }

64

67

68

69

70

72};

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

98

99

100

102 assert(Mask && "Processor Resource Mask cannot be zero!");

104}

105

106

107

108

109

111 unsigned DispatchWidth,

112 unsigned NumMicroOps,

114}

115}

116

117#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

This file defines the SmallVector class.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

Base class for user error types.

MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...

static char ID

Definition Support.h:30

std::error_code convertToErrorCode() const override

Convert this error to a std::error_code.

Definition Support.h:39

const T & Inst

Definition Support.h:32

void log(raw_ostream &OS) const override

Print an error message to an output stream.

Definition Support.h:37

InstructionError(std::string M, const T &MCI)

Definition Support.h:34

std::string Message

Definition Support.h:31

This class represents the number of cycles per resource (fractions of cycles).

Definition Support.h:52

unsigned getNumerator() const

Definition Support.h:65

LLVM_ABI ReleaseAtCycles & operator+=(const ReleaseAtCycles &RHS)

unsigned getDenominator() const

Definition Support.h:66

ReleaseAtCycles()

Definition Support.h:56

ReleaseAtCycles(unsigned Cycles, unsigned ResourceUnits=1)

Definition Support.h:57

This class implements an extremely fast bulk output stream that can only output to a stream.

LLVM_ABI double computeBlockRThroughput(const MCSchedModel &SM, unsigned DispatchWidth, unsigned NumMicroOps, ArrayRef< unsigned > ProcResourceUsage)

Compute the reciprocal block throughput from a set of processor resource cycles.

LLVM_ABI void computeProcResourceMasks(const MCSchedModel &SM, MutableArrayRef< uint64_t > Masks)

Populates vector Masks with processor resource masks.

unsigned getResourceStateIndex(uint64_t Mask)

Definition Support.h:101

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI std::error_code inconvertibleErrorCode()

The value returned by this function can be returned from convertToErrorCode for Error values where no...

unsigned Log2_64(uint64_t Value)

Return the floor log base 2 of the specified value, -1 if the value is zero.

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.

Implement std::hash so that hash_code can be used in STL containers.

Machine model for scheduling, bundling, and heuristics.