mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Add a function computeRegisterLiveness() to MachineBasicBlock. This uses analyzePhysReg() from r163694 to heuristically try and determine the liveness state of a physical register upon arrival at a particular instruction in a block.
The search for liveness is clipped to a specific number of instructions around the target MachineInstr, in order to avoid degenerating into an O(N^2) algorithm. It tries to use various clues about how instructions around (both before and after) a given MachineInstr use that register, to determine its state at the MachineInstr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163695 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -547,6 +547,28 @@ public:
|
||||
return findDebugLoc(MBBI.getInstrIterator());
|
||||
}
|
||||
|
||||
/// Possible outcome of a register liveness query to computeRegisterLiveness()
|
||||
enum LivenessQueryResult {
|
||||
LQR_Live, ///< Register is known to be live.
|
||||
LQR_OverlappingLive, ///< Register itself is not live, but some overlapping
|
||||
///< register is.
|
||||
LQR_Dead, ///< Register is known to be dead.
|
||||
LQR_Unknown ///< Register liveness not decidable from local
|
||||
///< neighborhood.
|
||||
};
|
||||
|
||||
/// computeRegisterLiveness - Return whether (physical) register \c Reg
|
||||
/// has been <def>ined and not <kill>ed as of just before \c MI.
|
||||
///
|
||||
/// Search is localised to a neighborhood of
|
||||
/// \c Neighborhood instructions before (searching for defs or kills) and
|
||||
/// Neighborhood instructions after (searching just for defs) MI.
|
||||
///
|
||||
/// \c Reg must be a physical register.
|
||||
LivenessQueryResult computeRegisterLiveness(const TargetRegisterInfo *TRI,
|
||||
unsigned Reg, MachineInstr *MI,
|
||||
unsigned Neighborhood=10);
|
||||
|
||||
// Debugging methods.
|
||||
void dump() const;
|
||||
void print(raw_ostream &OS, SlotIndexes* = 0) const;
|
||||
|
Reference in New Issue
Block a user