14 #ifndef LLVM_CODEGEN_FUNCTIONLOWERINGINFO_H 15 #define LLVM_CODEGEN_FUNCTIONLOWERINGINFO_H 38 class BranchProbabilityInfo;
39 class LegacyDivergenceAnalysis;
42 class MachineFunction;
44 class MachineRegisterInfo;
112 auto DuplIt = DuplicateMap.
find(V);
113 if (DuplIt != DuplicateMap.
end())
115 return SlotMap.
find(V);
199 return ValueMap.
count(V);
212 unsigned &R = ValueMap[V];
213 assert(R == 0 &&
"Already initialized this value register!");
221 if (!LiveOutRegInfo.inBounds(Reg))
242 if (NumSignBits == 1 && Known.
isUnknown())
245 LiveOutRegInfo.grow(Reg);
261 if (It == ValueMap.
end())
264 unsigned Reg = It->second;
268 LiveOutRegInfo.
grow(Reg);
269 LiveOutRegInfo[
Reg].IsValid =
false;
291 #endif // LLVM_CODEGEN_FUNCTIONLOWERINGINFO_H unsigned CreateReg(MVT VT, bool isDivergent=false)
CreateReg - Allocate a single virtual register for the given type.
This class represents an incoming formal argument to a Function.
This class represents lattice values for constants.
unsigned OrigNumPHINodesToUpdate
unsigned getCatchPadExceptionPointerVReg(const Value *CPI, const TargetRegisterClass *RC)
block Block Frequency true
DenseMap< const Value *, unsigned > CatchPadExceptionPointers
Track virtual registers created for exception pointers.
bool CanLowerReturn
CanLowerReturn - true iff the function's return value can be lowered to registers.
Keep track of frame indices allocated for statepoints as they could be used across basic block bounda...
unsigned DemoteRegister
DemoteRegister - if CanLowerReturn is false, DemoteRegister is a vreg allocated to hold a pointer to ...
DenseMap< const Value *, unsigned > ValueMap
ValueMap - Since we emit code for the function a basic block at a time, we must remember which virtua...
bool isExportedInst(const Value *V) const
isExportedInst - Return true if the specified value is an instruction exported from its block...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This file implements a class to represent arbitrary precision integral constant values and operations...
int getArgumentFrameIndex(const Argument *A)
getArgumentFrameIndex - Get frame index for the byval argument.
Type * getType() const
All values are typed, get the type of this value.
const LiveOutInfo * GetLiveOutRegInfo(unsigned Reg)
GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the register is a PHI destinat...
DenseSet< unsigned > RegsWithFixups
const LegacyDivergenceAnalysis * DA
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void clear()
clear - Clear out all the function-specific state.
iterator find(const_arg_type_t< KeyT > Val)
SlotMapTy SlotMap
Maps uniqued llvm IR values to the slots they were spilled in.
DenseMap< unsigned, const Value * > VirtReg2Value
VirtReg2Value map is needed by the Divergence Analysis driven instruction selection.
std::vector< std::pair< MachineInstr *, unsigned > > PHINodesToUpdate
PHINodesToUpdate - A list of phi instructions whose operand list will be updated after processing the...
The instances of the Type class are immutable: once they are created, they are never changed...
void grow(unsigned AtLeast)
void AddLiveOutRegInfo(unsigned Reg, unsigned NumSignBits, const KnownBits &Known)
AddLiveOutRegInfo - Adds LiveOutInfo for a register.
DenseMap< const Instruction *, StatepointSpillMap > StatepointSpillMaps
Maps gc.statepoint instructions to their corresponding StatepointSpillMap instances.
unsigned ExceptionPointerVirtReg
If the current MBB is a landing pad, the exception pointer and exception selector registers are copie...
SmallPtrSet< const BasicBlock *, 4 > VisitedBBs
VisitedBBs - The set of basic blocks visited thus far by instruction selection.
void ComputePHILiveOutRegInfo(const PHINode *)
ComputePHILiveOutRegInfo - Compute LiveOutInfo for a PHI's destination register based on the LiveOutI...
MachineBasicBlock * MBB
MBB - The current block.
SmallVector< unsigned, 50 > StatepointStackSlots
StatepointStackSlots - A list of temporary stack slots (frame indices) used to spill values at a stat...
bool SplitCSR
True if part of the CSRs will be handled via explicit copies.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
DenseMap< unsigned, unsigned > RegFixups
RegFixups - Registers which need to be replaced after isel is done.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
SmallVector< MachineInstr *, 8 > ArgDbgValues
ArgDbgValues - A list of DBG_VALUE instructions created during isel for function arguments that are i...
DenseMap< const Value *, const Value * > DuplicateMap
Maps llvm IR values to the values they were de-duplicated to.
BranchProbabilityInfo * BPI
bool isUnknown() const
Returns true if we don't know any bits.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
DenseMap< const Value *, ISD::NodeType > PreferredExtendType
Record the preferred extend type (ISD::SIGN_EXTEND or ISD::ZERO_EXTEND) for a value.
unsigned CreateRegs(const Value *V)
unsigned ExceptionSelectorVirtReg
Analysis providing branch probability information.
MachineRegisterInfo * RegInfo
DenseMap< const Argument *, int > ByValArgFrameIndexMap
ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.
bool isTokenTy() const
Return true if this is 'token'.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
SlotMapTy::const_iterator end() const
MachineBasicBlock::iterator InsertPt
MBB - The current insert position inside the current block.
BitVector DescribedArgs
Bitvector with a bit set if corresponding argument is described in ArgDbgValues.
const Value * getValueFromVirtualReg(unsigned Vreg)
This method is called from TargetLowerinInfo::isSDNodeSourceOfDivergence to get the Value correspondi...
DenseMap< const AllocaInst *, int > StaticAllocaMap
StaticAllocaMap - Keep track of frame indices for fixed sized allocas in the entry block...
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
LLVM_NODISCARD bool empty() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void InvalidatePHILiveOutRegInfo(const PHINode *PN)
InvalidatePHILiveOutRegInfo - Invalidates a PHI's LiveOutInfo, to be called when a block is visited b...
LLVM Value Representation.
SlotMapTy::const_iterator find(const Value *V) const
DenseMap< const BasicBlock *, MachineBasicBlock * > MBBMap
MBBMap - A mapping from LLVM basic blocks to their machine code entry.
const TargetLowering * TLI
void setArgumentFrameIndex(const Argument *A, int FI)
setArgumentFrameIndex - Record frame index for the byval argument.
unsigned InitializeRegForValue(const Value *V)