12#ifndef LLVM_CODEGEN_GLOBALISEL_CSEINFO_H
13#define LLVM_CODEGEN_GLOBALISEL_CSEINFO_H
34 explicit UniqueMachineInstr(
const MachineInstr *MI) : MI(MI) {}
58LLVM_ABI std::unique_ptr<CSEConfigBase>
79 std::unique_ptr<CSEConfigBase> CSEOpt;
116 bool HandlingRecordedInstrs =
false;
149 CSEOpt = std::move(Opt);
152 bool shouldCSE(
unsigned Opc)
const;
156 void countOpcodeHit(
unsigned Opc);
167class TargetRegisterClass;
177 : ID(ID), MRI(MRI) {}
214 bool AlreadyComputed =
false;
222 bool ReCompute =
false);
244 Wrapper.releaseMemory();
245 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
virtual ~CSEConfigConstantOnly()=default
bool shouldCSEOpc(unsigned Opc) override
------â CSEConfigFull -------â ///
virtual ~CSEConfigFull()=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)
void setMF(MachineFunction &MFunc)
LLVM_ABI GISelCSEInfo & get(std::unique_ptr< CSEConfigBase > CSEOpt, bool ReCompute=false)
Takes a CSEConfigBase object that defines what opcodes get CSEd.
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.
A class that wraps MachineInstrs and derives from FoldingSetNode in order to be uniqued in a CSEMap.
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
LLVM_ABI std::unique_ptr< CSEConfigBase > getStandardCSEConfigForOpt(CodeGenOptLevel Level)
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
CodeGenOptLevel
Code generation optimization level.
All attributes(register class or bank and low-level type) a virtual register can have.