diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-03-26 00:07:25 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-03-26 00:07:25 +0000 |
commit | 7b4a1a221bd19fd1f9d0dac7857d97e22f91a72e (patch) | |
tree | f148a47d6f0146eafcd4f334f5f0a976eb85bba5 /llvm/lib/CodeGen | |
parent | 5d99d7fe79e201b4c0efd2989d9e0de61332fe3b (diff) | |
download | bcm5719-llvm-7b4a1a221bd19fd1f9d0dac7857d97e22f91a72e.tar.gz bcm5719-llvm-7b4a1a221bd19fd1f9d0dac7857d97e22f91a72e.zip |
Try trivial remat before the coalescer gives up on a vr / physreg coalescing for fear of tying up a physical register.
llvm-svn: 99575
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index f51bedd3347..15ca3740b8f 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -1664,7 +1664,8 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) { if (JoinPInt.ranges.size() > 1000) { mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg); ++numAborts; - DEBUG(dbgs() << "\tPhysical register too complicated, abort!\n"); + DEBUG(dbgs() + << "\tPhysical register live interval too complicated, abort!\n"); return false; } @@ -1675,6 +1676,11 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) { if (Length > Threshold && (((float)std::distance(mri_->use_nodbg_begin(JoinVReg), mri_->use_nodbg_end()) / Length) < Ratio)) { + // Before giving up coalescing, if definition of source is defined by + // trivial computation, try rematerializing it. + if (ReMaterializeTrivialDef(SrcInt, DstReg, DstSubIdx, CopyMI)) + return true; + mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg); ++numAborts; DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n"); |