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." 59 WorkListMaintainer(WorkListTy &WorkList)
61 virtual ~WorkListMaintainer() {
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);
147 while (!WorkList.
empty()) {
151 Observer.reportFullyCreatedInstrs();
153 MFChanged |= Changed;
157 "CSEInfo is not consistent. Likely missing calls to " 158 "observer on mutations"));
A simple RAII based Delegate installer.
void deferred_insert(MachineInstr *I)
This class represents lattice values for constants.
const MachineFunctionProperties & getProperties() const
Get the function properties.
Combiner(CombinerInfo &CombinerInfo, const TargetPassConfig *TPC)
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI, MachineIRBuilder &B) const =0
Attempt to combine instructions using MI as the root.
Target-Independent Code Generator Pass Configuration Options.
void eraseFromParentAndMarkDBGValuesForRemoval()
Unlink 'this' from the containing basic block and delete it.
reverse_iterator rbegin()
Analysis containing CSE Info
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Abstract class that contains various methods for clients to notify about changes.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
bool errorToBool(Error Err)
Helper for converting an Error to a bool.
This file implements a version of MachineIRBuilder which CSEs insts within a MachineBasicBlock.
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.")
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Helper class to build MachineInstr.
iterator_range< po_iterator< T > > post_order(const T &G)
bool combineMachineInstrs(MachineFunction &MF, GISelCSEInfo *CSEInfo)
If CSEInfo is not null, then the Combiner will setup observer for CSEInfo and instantiate a CSEMIRBui...
std::unique_ptr< MachineIRBuilder > Builder
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
MachineInstr * pop_back_val()
This file declares the MachineIRBuilder class.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachineRegisterInfo * MRI
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...
Representation of each machine instruction.
void addObserver(GISelChangeObserver *O)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool hasProperty(Property P) const
Simple wrapper observer that takes several observers, and calls each one for each event.