summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-09-17 21:13:11 +0000
committerDale Johannesen <dalej@apple.com>2008-09-17 21:13:11 +0000
commitf8610ebebc3e70a7a398dc538ee068e64d081d3b (patch)
tree16435b7d8de7d783997f521da1ab2bd2d29843a9 /llvm/lib/CodeGen/MachineInstr.cpp
parentd34d6dc458a9a5bc7f0de01c4cae880424125bf9 (diff)
downloadbcm5719-llvm-f8610ebebc3e70a7a398dc538ee068e64d081d3b.tar.gz
bcm5719-llvm-f8610ebebc3e70a7a398dc538ee068e64d081d3b.zip
Add a bit to mark operands of asm's that conflict
with an earlyclobber operand elsewhere. Propagate this bit and the earlyclobber bit through SDISel. Change linear-scan RA not to allocate regs in a way that conflicts with an earlyclobber. See also comments. llvm-svn: 56290
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 7f2a7b6a077..a365f20300f 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -109,6 +109,7 @@ void MachineOperand::ChangeToRegister(unsigned Reg, bool isDef, bool isImp,
// register's use/def lists.
if (isRegister()) {
assert(!isEarlyClobber());
+ assert(!isEarlyClobber() && !overlapsEarlyClobber());
setReg(Reg);
} else {
// Otherwise, change this to a register and set the reg#.
@@ -128,6 +129,7 @@ void MachineOperand::ChangeToRegister(unsigned Reg, bool isDef, bool isImp,
IsKill = isKill;
IsDead = isDead;
IsEarlyClobber = false;
+ OverlapsEarlyClobber = false;
SubReg = 0;
}
@@ -183,13 +185,20 @@ void MachineOperand::print(std::ostream &OS, const TargetMachine *TM) const {
OS << "%mreg" << getReg();
}
- if (isDef() || isKill() || isDead() || isImplicit() || isEarlyClobber()) {
+ if (isDef() || isKill() || isDead() || isImplicit() || isEarlyClobber() ||
+ overlapsEarlyClobber()) {
OS << "<";
bool NeedComma = false;
+ if (overlapsEarlyClobber()) {
+ NeedComma = true;
+ OS << "overlapsearly";
+ }
if (isImplicit()) {
+ if (NeedComma) OS << ",";
OS << (isDef() ? "imp-def" : "imp-use");
NeedComma = true;
} else if (isDef()) {
+ if (NeedComma) OS << ",";
if (isEarlyClobber())
OS << "earlyclobber,";
OS << "def";
OpenPOWER on IntegriCloud