diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-20 04:52:48 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-20 04:52:48 +0000 |
commit | d0a38a8daa4c5d1cfaa12720b89bdd21a19f6b05 (patch) | |
tree | d5bd1b0c00c57b44dca19b4ececbd6b50aac80e3 /llvm/lib/CodeGen | |
parent | 64d82b74dd16213bc58ba9feed846760df0bfe5f (diff) | |
download | bcm5719-llvm-d0a38a8daa4c5d1cfaa12720b89bdd21a19f6b05.tar.gz bcm5719-llvm-d0a38a8daa4c5d1cfaa12720b89bdd21a19f6b05.zip |
Avoid deleting extra copies when RegistersDefinedFromSameValue is true.
This function adds copies to be erased to DupCopies, avoid also adding
them to DeadCopies.
llvm-svn: 157147
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/RegisterCoalescer.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index f529f1899ca..149b6b751f9 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -1310,9 +1310,10 @@ bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) { // DstReg is known to be a register in the LHS interval. If the src is // from the RHS interval, we can use its value #. - if (!CP.isCoalescable(MI) && - !RegistersDefinedFromSameValue(*LIS, *TRI, CP, VNI, OtherVNI, - DupCopies)) + if (CP.isCoalescable(MI)) + DeadCopies.push_back(MI); + else if (!RegistersDefinedFromSameValue(*LIS, *TRI, CP, VNI, OtherVNI, + DupCopies)) continue; LHSValsDefinedFromRHS[VNI] = OtherVNI; @@ -1339,13 +1340,13 @@ bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) { // DstReg is known to be a register in the RHS interval. If the src is // from the LHS interval, we can use its value #. - if (!CP.isCoalescable(MI) && - !RegistersDefinedFromSameValue(*LIS, *TRI, CP, VNI, OtherVNI, - DupCopies)) + if (CP.isCoalescable(MI)) + DeadCopies.push_back(MI); + else if (!RegistersDefinedFromSameValue(*LIS, *TRI, CP, VNI, OtherVNI, + DupCopies)) continue; RHSValsDefinedFromLHS[VNI] = OtherVNI; - DeadCopies.push_back(MI); } LHSValNoAssignments.resize(LHS.getNumValNums(), -1); |