Go to the documentation of this file.
25 #define DEBUG_TYPE "gi-combiner"
31 "GlobalISel Combiner",
32 "Control the rules which are enabled. These options all take a comma "
33 "separated list of rules to disable and may be specified by number "
34 "or number range (e.g. 1-10)."
36 " They may also be specified by name."
58 WorkListMaintainer(WorkListTy &WorkList) : WorkList(WorkList) {}
59 virtual ~WorkListMaintainer() =
default;
79 void reportFullyCreatedInstrs() {
82 dbgs() <<
"Created: ";
91 : CInfo(
Info), TPC(TPC) {
104 CSEInfo ? std::make_unique<CSEMIRBuilder>() : std::make_unique<MachineIRBuilder>();
114 bool MFChanged =
false;
124 WorkListMaintainer Observer(WorkList);
135 CurMI.eraseFromParent();
143 while (!WorkList.
empty()) {
147 Observer.reportFullyCreatedInstrs();
149 MFChanged |= Changed;
154 if (
auto E = CSEInfo->
verify()) {
156 assert(
false &&
"CSEInfo is not consistent. Likely missing calls to "
157 "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
auto reverse(ContainerTy &&C, std::enable_if_t< has_rbegin< ContainerTy >::value > *=nullptr)
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
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
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.")
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)
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...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.