mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
CreateVirtualRegisters does trivial copy coalescing. If a node def is used by a single CopyToReg, it reuses the virtual register assigned to the CopyToReg. This won't work for SDNode that is a clone or is itself cloned. Disable this optimization for those nodes or it can end up with non-SSA machine instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -250,6 +250,7 @@ namespace llvm {
|
||||
bool isAvailable : 1; // True once available.
|
||||
bool isScheduled : 1; // True once scheduled.
|
||||
bool isScheduleHigh : 1; // True if preferable to schedule high.
|
||||
bool isCloned : 1; // True if this node has been cloned.
|
||||
private:
|
||||
bool isDepthCurrent : 1; // True if Depth is current.
|
||||
bool isHeightCurrent : 1; // True if Height is current.
|
||||
@@ -266,8 +267,8 @@ namespace llvm {
|
||||
Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0),
|
||||
isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false),
|
||||
isPending(false), isAvailable(false), isScheduled(false),
|
||||
isScheduleHigh(false), isDepthCurrent(false), isHeightCurrent(false),
|
||||
Depth(0), Height(0),
|
||||
isScheduleHigh(false), isCloned(false),
|
||||
isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0),
|
||||
CopyDstRC(NULL), CopySrcRC(NULL) {}
|
||||
|
||||
/// SUnit - Construct an SUnit for post-regalloc scheduling to represent
|
||||
@@ -277,8 +278,8 @@ namespace llvm {
|
||||
Latency(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0),
|
||||
isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false),
|
||||
isPending(false), isAvailable(false), isScheduled(false),
|
||||
isScheduleHigh(false), isDepthCurrent(false), isHeightCurrent(false),
|
||||
Depth(0), Height(0),
|
||||
isScheduleHigh(false), isCloned(false),
|
||||
isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0),
|
||||
CopyDstRC(NULL), CopySrcRC(NULL) {}
|
||||
|
||||
/// setNode - Assign the representative SDNode for this SUnit.
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace llvm {
|
||||
/// VRBaseMap contains, for each already emitted node, the first virtual
|
||||
/// register number for the results of the node.
|
||||
///
|
||||
void EmitNode(SDNode *Node, bool IsClone,
|
||||
void EmitNode(SDNode *Node, bool IsClone, bool HasClone,
|
||||
DenseMap<SDValue, unsigned> &VRBaseMap);
|
||||
|
||||
virtual MachineBasicBlock *EmitSchedule();
|
||||
@@ -144,11 +144,12 @@ namespace llvm {
|
||||
/// EmitCopyFromReg - Generate machine code for an CopyFromReg node or an
|
||||
/// implicit physical register output.
|
||||
void EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone,
|
||||
unsigned SrcReg,
|
||||
bool IsCloned, unsigned SrcReg,
|
||||
DenseMap<SDValue, unsigned> &VRBaseMap);
|
||||
|
||||
void CreateVirtualRegisters(SDNode *Node, MachineInstr *MI,
|
||||
const TargetInstrDesc &II, bool IsClone,
|
||||
bool IsCloned,
|
||||
DenseMap<SDValue, unsigned> &VRBaseMap);
|
||||
|
||||
/// BuildSchedUnits, AddSchedEdges - Helper functions for BuildSchedGraph.
|
||||
|
||||
Reference in New Issue
Block a user