LLVM: lib/CodeGen/LiveStacks.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

19using namespace llvm;

20

21#define DEBUG_TYPE "livestacks"

22

25 "Live Stack Slot Analysis", false, false)

29

31

33 AU.setPreservesAll();

37}

38

40

41 VNInfoAllocator.Reset();

42 S2IMap.clear();

43 S2RCMap.clear();

44}

45

51

54 assert(Slot >= 0 && "Spill slot indice must be >= 0");

55 SS2IntervalMap::iterator I = S2IMap.find(Slot);

56 if (I == S2IMap.end()) {

57 I = S2IMap

58 .emplace(

59 std::piecewise_construct, std::forward_as_tuple(Slot),

61 .first;

62 S2RCMap.insert(std::make_pair(Slot, RC));

63 } else {

64

66 OldRC = TRI->getCommonSubClass(OldRC, RC);

67 }

68 return I->second;

69}

70

72

76 Impl.init(MF);

77 return Impl;

78}

85

88 Impl.init(MF);

89 return false;

90}

91

93

97

98

100

101 OS << "********** INTERVALS **********\n";

103 I->second.print(OS);

104 int Slot = I->first;

106 if (RC)

107 OS << " [" << TRI->getRegClassName(RC) << "]\n";

108 else

109 OS << " [Unknown]\n";

110 }

111}

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

#define INITIALIZE_PASS_DEPENDENCY(depName)

#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)

#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)

PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)

Get the result of an analysis pass for a given IR unit.

Represent the analysis usage information of a pass.

Module * getParent()

Get the module that this global value is contained inside of...

LiveInterval - This class represents the liveness of a register, or stack slot.

LiveStacks run(MachineFunction &MF, MachineFunctionAnalysisManager &)

Definition LiveStacks.cpp:73

PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &AM)

Definition LiveStacks.cpp:80

void print(raw_ostream &O, const Module *=nullptr) const override

print - Implement the dump method.

Definition LiveStacks.cpp:94

void getAnalysisUsage(AnalysisUsage &AU) const override

getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...

Definition LiveStacks.cpp:32

bool runOnMachineFunction(MachineFunction &) override

runOnMachineFunction - pass entry point

Definition LiveStacks.cpp:86

LiveStacksWrapperLegacy()

void releaseMemory() override

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...

Definition LiveStacks.cpp:92

SS2IntervalMap::const_iterator const_iterator

LiveInterval & getOrCreateInterval(int Slot, const TargetRegisterClass *RC)

Definition LiveStacks.cpp:53

void print(raw_ostream &O, const Module *M=nullptr) const

print - Implement the dump method.

Definition LiveStacks.cpp:99

const TargetRegisterClass * getIntervalRegClass(int Slot) const

const_iterator end() const

const_iterator begin() const

void init(MachineFunction &MF)

init - analysis entry point

Definition LiveStacks.cpp:46

void releaseMemory()

Definition LiveStacks.cpp:39

void getAnalysisUsage(AnalysisUsage &AU) const override

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.

const TargetSubtargetInfo & getSubtarget() const

getSubtarget - Return the subtarget for which this machine code is being compiled.

Function & getFunction()

Return the LLVM function that this machine code represents.

A Module instance is used to store all the information related to an LLVM module.

A set of analyses that are preserved following a run of a transformation pass.

static PreservedAnalyses all()

Construct a special preserved set that preserves all passes.

static Register index2StackSlot(int FI)

Convert a non-negative frame index to a stack slot register value.

virtual const TargetRegisterInfo * getRegisterInfo() const =0

Return the target's register information.

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

unsigned ID

LLVM IR allows to use arbitrary numbers as calling convention identifiers.

This is an optimization pass for GlobalISel generic memory operations.

Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)

LLVM_ABI char & LiveStacksID

LiveStacks pass. An analysis keeping track of the liveness of stack slots.

Definition LiveStacks.cpp:30

AnalysisManager< MachineFunction > MachineFunctionAnalysisManager

A special type used by analysis passes to provide an address that identifies that particular analysis...