LLVM  8.0.1
GISelChangeObserver.cpp
Go to the documentation of this file.
1 //===-- lib/CodeGen/GlobalISel/GISelChangeObserver.cpp --------------------===//
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 //
10 // This file constains common code to combine machine functions at generic
11 // level.
12 //===----------------------------------------------------------------------===//
13 
16 
17 using namespace llvm;
18 
20  const MachineRegisterInfo &MRI, unsigned Reg) {
21  for (auto &ChangingMI : MRI.use_instructions(Reg)) {
22  changingInstr(ChangingMI);
23  ChangingAllUsesOfReg.insert(&ChangingMI);
24  }
25 }
26 
28  for (auto *ChangedMI : ChangingAllUsesOfReg)
29  changedInstr(*ChangedMI);
30 }
31 
34  : MF(MF), Delegate(Del) {
35  // Register this as the delegate for handling insertions and deletions of
36  // instructions.
37  MF.setDelegate(Del);
38 }
39 
This class represents lattice values for constants.
Definition: AllocatorList.h:24
unsigned Reg
void resetDelegate(Delegate *delegate)
Reset the currently registered delegate - otherwise assert.
void finishedChangingAllUsesOfReg()
All instructions reported as changing by changingAllUsesOfReg() have finished being changed...
void setDelegate(Delegate *delegate)
Set the delegate.
unsigned const MachineRegisterInfo * MRI
void changingAllUsesOfReg(const MachineRegisterInfo &MRI, unsigned Reg)
All the instructions using the given register are being changed.
virtual void changingInstr(MachineInstr &MI)=0
This instruction is about to be mutated in some way.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
RAIIDelegateInstaller(MachineFunction &MF, MachineFunction::Delegate *Del)
iterator_range< use_instr_iterator > use_instructions(unsigned Reg) const
virtual void changedInstr(MachineInstr &MI)=0
This instruction was mutated in some way.