Go to the documentation of this file.
26 #define DEBUG_TYPE "gi-combiner"
32 "GlobalISel Combiner",
33 "Control the rules which are enabled. These options all take a comma "
34 "separated list of rules to disable and may be specified by number "
35 "or number range (e.g. 1-10)."
37 " They may also be specified by name."
61 WorkListMaintainer(WorkListTy &WorkList) : WorkList(WorkList) {}
62 virtual ~WorkListMaintainer() =
default;
82 void reportFullyCreatedInstrs() {
85 dbgs() <<
"Created: ";
94 : CInfo(
Info), TPC(TPC) {
107 CSEInfo ? std::make_unique<CSEMIRBuilder>() : std::make_unique<MachineIRBuilder>();
117 bool MFChanged =
false;
127 WorkListMaintainer Observer(WorkList);
139 CurMI.eraseFromParent();
147 while (!WorkList.
empty()) {
151 Observer.reportFullyCreatedInstrs();
153 MFChanged |= Changed;
158 if (
auto E = CSEInfo->
verify()) {
160 assert(
false &&
"CSEInfo is not consistent. Likely missing calls to "
161 "observer on mutations.");
bool hasProperty(Property P) const
This is an optimization pass for GlobalISel generic memory operations.
void deferred_insert(MachineInstr *I)
std::unique_ptr< MachineIRBuilder > Builder
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI, MachineIRBuilder &B) const =0
Attempt to combine instructions using MI as the root.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
__FakeVCSRevision h endif() endif() set(generated_files "$
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
A simple RAII based Delegate installer.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const MachineFunctionProperties & getProperties() const
Get the function properties.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
MachineRegisterInfo * MRI
void salvageDebugInfo(const MachineRegisterInfo &MRI, MachineInstr &MI)
Assuming the instruction MI is going to be deleted, attempt to salvage debug users of MI by writing t...
Analysis containing CSE Info
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
Target-Independent Code Generator Pass Configuration Options.
Helper class to build MachineInstr.
Representation of each machine instruction.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isTriviallyDead(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Check whether an instruction MI is dead: it only defines dead virtual registers, and doesn't have oth...
cl::OptionCategory GICombinerOptionCategory("GlobalISel Combiner", "Control the rules which are enabled. These options all take a comma " "separated list of rules to disable and may be specified by number " "or number range (e.g. 1-10)." " They may also be specified by name.")
bool insert(const value_type &X)
Insert a new element into the SetVector.
MachineInstr * pop_back_val()
Abstract class that contains various methods for clients to notify about changes.
iterator_range< po_iterator< T > > post_order(const T &G)
Combiner(CombinerInfo &CombinerInfo, const TargetPassConfig *TPC)
void addObserver(GISelChangeObserver *O)
auto reverse(ContainerTy &&C)
Simple wrapper observer that takes several observers, and calls each one for each event.
bool combineMachineInstrs(MachineFunction &MF, GISelCSEInfo *CSEInfo)
If CSEInfo is not null, then the Combiner will setup observer for CSEInfo and instantiate a CSEMIRBui...
A vector that has set insertion semantics.