LLVM: include/llvm/CodeGen/AntiDepBreaker.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CODEGEN_ANTIDEPBREAKER_H

15#define LLVM_CODEGEN_ANTIDEPBREAKER_H

16

22#include

23#include

24

25namespace llvm {

26

28

29

30

32public:

34 std::vector<std::pair<MachineInstr *, MachineInstr *>>;

35

37

38

40

41

42

46 unsigned InsertPosIndex,

48

49

50

52 unsigned InsertPosIndex) = 0;

53

54

56

57

58

60 if (MI.isDebugValue()) {

61 if (MI.getDebugOperand(0).isReg() &&

62 MI.getDebugOperand(0).getReg() == OldReg)

63 MI.getDebugOperand(0).setReg(NewReg);

64 } else if (MI.isDebugPHI()) {

65 if (MI.getOperand(0).isReg() &&

66 MI.getOperand(0).getReg() == OldReg)

67 MI.getOperand(0).setReg(NewReg);

68 } else {

70 }

71 }

72

73

74

77

78

80 for (const auto &DV : make_range(DbgValues.crbegin(), DbgValues.crend())) {

82 if ((PrevMI == ParentMI) || (PrevMI == PrevDbgMI)) {

85 PrevDbgMI = DbgMI;

86 } else if (PrevDbgMI) {

87 break;

88 }

89 }

90 }

91};

92

94 MachineFunction &MFi, const RegisterClassInfo &RCI,

96

98 const RegisterClassInfo &RCI);

99

100}

101

102#endif

This class works in conjunction with the post-RA scheduler to rename registers to break register anti...

Definition AntiDepBreaker.h:31

void UpdateDbgValue(MachineInstr &MI, MCRegister OldReg, MCRegister NewReg)

Update DBG_VALUE or DBG_PHI if dependency breaker is updating other machine instruction to use NewReg...

Definition AntiDepBreaker.h:59

virtual void FinishBlock()=0

Finish anti-dep breaking for a basic block.

virtual unsigned BreakAntiDependencies(const std::vector< SUnit > &SUnits, MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned InsertPosIndex, DbgValueVector &DbgValues)=0

Identifiy anti-dependencies within a basic-block region and break them by renaming registers.

void UpdateDbgValues(const DbgValueVector &DbgValues, MachineInstr *ParentMI, MCRegister OldReg, MCRegister NewReg)

Update all DBG_VALUE instructions that may be affected by the dependency breaker's update of ParentMI...

Definition AntiDepBreaker.h:75

virtual void Observe(MachineInstr &MI, unsigned Count, unsigned InsertPosIndex)=0

Update liveness information to account for the current instruction, which will not be scheduled.

virtual ~AntiDepBreaker()

virtual void StartBlock(MachineBasicBlock *BB)=0

Initialize anti-dep breaking for a new basic block.

std::vector< std::pair< MachineInstr *, MachineInstr * > > DbgValueVector

Definition AntiDepBreaker.h:33

Wrapper class representing physical registers. Should be passed by value.

MachineInstrBundleIterator< MachineInstr > iterator

Representation of each machine instruction.

SmallVectorImpl< const TargetRegisterClass * > RegClassVector

This provides a very simple, boring adaptor for a begin and end iterator into a range type.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

This is an optimization pass for GlobalISel generic memory operations.

AntiDepBreaker * createAggressiveAntiDepBreaker(MachineFunction &MFi, const RegisterClassInfo &RCI, TargetSubtargetInfo::RegClassVector &CriticalPathRCs)

iterator_range< T > make_range(T x, T y)

Convenience function for iterating over sub-ranges.

FunctionAddr VTableAddr Count

AntiDepBreaker * createCriticalAntiDepBreaker(MachineFunction &MFi, const RegisterClassInfo &RCI)