12#ifndef LLVM_CODEGEN_GLOBALISEL_CSEINFO_H
13#define LLVM_CODEGEN_GLOBALISEL_CSEINFO_H
35 explicit UniqueMachineInstr(
const MachineInstr *MI) : MI(MI) {}
59LLVM_ABI std::unique_ptr<CSEConfigBase>
80 std::unique_ptr<CSEConfigBase> CSEOpt;
117 bool HandlingRecordedInstrs =
false;
150 CSEOpt = std::move(Opt);
153 bool shouldCSE(
unsigned Opc)
const;
157 void countOpcodeHit(
unsigned Opc);
168class TargetRegisterClass;
178 : ID(ID), MRI(MRI) {}
215 bool AlreadyComputed =
false;
234 using Result = std::unique_ptr<GISelCSEInfo>;
257 Wrapper.releaseMemory();
258 Wrapper.setComputed(
false);
This file defines the BumpPtrAllocator interface.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
This file defines a hash set that can be used to remove duplication of nodes in a graph.
This contains common code to allow clients to notify changes to machine instr.
Represent the analysis usage information of a pass.
bool shouldCSEOpc(unsigned Opc) override
~CSEConfigConstantOnly() override=default
bool shouldCSEOpc(unsigned Opc) override
------— CSEConfigFull -------— ///
~CSEConfigFull() override=default
Lightweight error class with error context and mandatory checking.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
const GISelCSEAnalysisWrapper & getCSEWrapper() const
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
GISelCSEAnalysisWrapper & getCSEWrapper()
GISelCSEAnalysisWrapperPass()
Simple wrapper that does the following.
void setComputed(bool Computed)
LLVM_ABI GISelCSEInfo & get(std::unique_ptr< CSEConfigBase > CSEOpt)
Takes a CSEConfigBase object that defines what opcodes get CSEd.
void setMF(MachineFunction &MFunc)
LLVM_ABI Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
LLVM_ABI GISelCSEAnalysis(TargetMachine *TM)
std::unique_ptr< GISelCSEInfo > Result
void recordNewInstruction(MachineInstr *MI)
Records a newly created inst in a list and lazily insert it to the CSEMap.
friend class CSEMIRBuilder
void setMF(MachineFunction &MF)
-----— GISelCSEInfo ----------—//
void setCSEConfig(std::unique_ptr< CSEConfigBase > Opt)
void handleRecordedInsts()
Use this callback to insert all the recorded instructions.
void handleRecordedInst(MachineInstr *MI)
Use this callback to inform CSE about a newly fully created instruction.
void handleRemoveInst(MachineInstr *MI)
Remove this inst from the CSE map.
Abstract class that contains various methods for clients to notify about changes.
LLVM_ABI const GISelInstProfileBuilder & addNodeIDOpcode(unsigned Opc) const
LLVM_ABI const GISelInstProfileBuilder & addNodeIDRegNum(Register Reg) const
LLVM_ABI const GISelInstProfileBuilder & addNodeIDFlag(unsigned Flag) const
LLVM_ABI const GISelInstProfileBuilder & addNodeIDImmediate(int64_t Imm) const
LLVM_ABI const GISelInstProfileBuilder & addNodeIDReg(Register Reg) const
LLVM_ABI const GISelInstProfileBuilder & addNodeID(const MachineInstr *MI) const
LLVM_ABI const GISelInstProfileBuilder & addNodeIDMBB(const MachineBasicBlock *MBB) const
GISelInstProfileBuilder(FoldingSetNodeID &ID, const MachineRegisterInfo &MRI)
LLVM_ABI const GISelInstProfileBuilder & addNodeIDRegType(const LLT Ty) const
LLVM_ABI const GISelInstProfileBuilder & addNodeIDMachineOperand(const MachineOperand &MO) const
MachineFunctionPass(char &ID)
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
This class implements the register bank concept.
Wrapper class representing virtual and physical registers.
Primary interface to the complete machine description for the target machine.
A class that wraps MachineInstrs and derives from FoldingSetNode in order to be uniqued in a CSEMap.
LLVM_ABI void Profile(FoldingSetNodeID &ID)
friend class GISelCSEInfo
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
FoldingSetBase::Node FoldingSetNode
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI std::unique_ptr< CSEConfigBase > getStandardCSEConfigForOpt(CodeGenOptLevel Level)
CodeGenOptLevel
Code generation optimization level.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
All attributes(register class or bank and low-level type) a virtual register can have.