[llvm] r220302 - [PBQP] Fix coalescing benefits
Arnaud A. de Grandmaison
arnaud.degrandmaison at arm.com
Tue Oct 21 09:49:26 PDT 2014
This one was found by post-commit visual inspection --- I do not have any testcase handy. But I will see if I can come up with one.
Cheers,
Arnaud
From: David Blaikie [mailto:dblaikie at gmail.com]
Sent: 21 October 2014 18:37
To: Arnaud De Grandmaison
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm] r220302 - [PBQP] Fix coalescing benefits
On Tue, Oct 21, 2014 at 9:24 AM, Arnaud A. de Grandmaison <arnaud.degrandmaison at arm.com> wrote:
Author: aadg
Date: Tue Oct 21 11:24:15 2014
New Revision: 220302
URL: http://llvm.org/viewvc/llvm-project?rev=220302 <http://llvm.org/viewvc/llvm-project?rev=220302&view=rev> &view=rev
Log:
[PBQP] Fix coalescing benefits
As coalescing registers is a benefit, the cost should be improved (i.e. made smaller) when coalescing is possible.
Modified:
llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=220302 <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=220302&r1=220301&r2=220302&view=diff> &r1=220301&r2=220302&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Tue Oct 21 11:24:15 2014
@@ -350,7 +350,7 @@ public:
if (PRegOpt < Allowed.size()) {
PBQPRAGraph::RawVector NewCosts(G.getNodeCosts(NId));
- NewCosts[PRegOpt + 1] += CBenefit;
+ NewCosts[PRegOpt + 1] -= CBenefit;
Test coverage for this?
G.setNodeCosts(NId, std::move(NewCosts));
}
} else {
@@ -395,7 +395,7 @@ private:
for (unsigned J = 0; J != Allowed2.size(); ++J) {
unsigned PReg2 = Allowed2[J];
if (PReg1 == PReg2)
- CostMat[I + 1][J + 1] += -Benefit;
+ CostMat[I + 1][J + 1] -= Benefit;
}
}
}
_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141021/12e5c7eb/attachment.html>
More information about the llvm-commits
mailing list