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 | 91aac1015e6714d959801dd8d60f55a72827dc4d (patch) | |
tree | c8440b8031a0fe3d7c63fcf9145ffc930759c547 /lib/CodeGen/RegAllocLinearScan.cpp | |
parent | 870e4bef419b1bd3e5ee05673975f1c05198b612 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56290 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 2cfa755d16..a99ccab37c 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/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) |