diff options
author | Dale Johannesen <dalej@apple.com> | 2008-09-17 21:13:11 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-09-17 21:13:11 +0000 |
commit | f8610ebebc3e70a7a398dc538ee068e64d081d3b (patch) | |
tree | 16435b7d8de7d783997f521da1ab2bd2d29843a9 /llvm/lib/CodeGen/RegAllocLinearScan.cpp | |
parent | d34d6dc458a9a5bc7f0de01c4cae880424125bf9 (diff) | |
download | bcm5719-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/RegAllocLinearScan.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocLinearScan.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index 2cfa755d169..a99ccab37c7 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp @@ -1050,7 +1050,8 @@ unsigned RALinScan::getFreePhysReg(LiveInterval *cur) { TargetRegisterClass::iterator E = RC->allocation_order_end(*mf_); assert(I != E && "No allocatable register in this register class!"); for (; I != E; ++I) - if (prt_->isRegAvail(*I)) { + if (prt_->isRegAvail(*I) && + li_->noEarlyclobberConflict(cur->reg, *vrm_, *I)) { FreeReg = *I; if (FreeReg < inactiveCounts.size()) FreeRegInactiveCount = inactiveCounts[FreeReg]; @@ -1070,7 +1071,8 @@ unsigned RALinScan::getFreePhysReg(LiveInterval *cur) { for (; I != E; ++I) { unsigned Reg = *I; if (prt_->isRegAvail(Reg) && Reg < inactiveCounts.size() && - FreeRegInactiveCount < inactiveCounts[Reg]) { + FreeRegInactiveCount < inactiveCounts[Reg] && + li_->noEarlyclobberConflict(cur->reg, *vrm_, Reg)) { FreeReg = Reg; FreeRegInactiveCount = inactiveCounts[Reg]; if (FreeRegInactiveCount == MaxInactiveCount) |