As coalescing registers is a benefit, the cost should be improved (i.e. made smaller) when coalescing is possible.
llvm-svn: 220302
if (PRegOpt < Allowed.size()) {
PBQPRAGraph::RawVector NewCosts(G.getNodeCosts(NId));
- NewCosts[PRegOpt + 1] += CBenefit;
+ NewCosts[PRegOpt + 1] -= CBenefit;
G.setNodeCosts(NId, std::move(NewCosts));
}
} else {
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;
}
}
}