[llvm] r217518 - [AArch64] Address Chad's post commit review comments for r217504 (PBQP experimental support)
Arnaud A. de Grandmaison
arnaud.degrandmaison at arm.com
Wed Sep 10 10:03:25 PDT 2014
Author: aadg
Date: Wed Sep 10 12:03:25 2014
New Revision: 217518
URL: http://llvm.org/viewvc/llvm-project?rev=217518&view=rev
Log:
[AArch64] Address Chad's post commit review comments for r217504 (PBQP experimental support)
Modified:
llvm/trunk/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp?rev=217518&r1=217517&r2=217518&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp Wed Sep 10 12:03:25 2014
@@ -31,7 +31,6 @@
#include "llvm/Support/raw_ostream.h"
#define PBQP_BUILDER PBQPBuilderWithCoalescing
-//#define PBQP_BUILDER PBQPBuilder
using namespace llvm;
@@ -195,8 +194,8 @@ bool A57PBQPBuilder::addIntraChainConstr
return false;
if (isPhysicalReg(Rd) || isPhysicalReg(Ra)) {
- dbgs() << "Rd is a physical reg:" << isPhysicalReg(Rd) << '\n';
- dbgs() << "Ra is a physical reg:" << isPhysicalReg(Ra) << '\n';
+ DEBUG(dbgs() << "Rd is a physical reg:" << isPhysicalReg(Rd) << '\n');
+ DEBUG(dbgs() << "Ra is a physical reg:" << isPhysicalReg(Ra) << '\n');
return false;
}
@@ -216,9 +215,9 @@ bool A57PBQPBuilder::addIntraChainConstr
bool livesOverlap = ld.overlaps(la);
PBQP::Matrix costs(vRdAllowed->size() + 1, vRaAllowed->size() + 1, 0);
- for (unsigned i = 0; i != vRdAllowed->size(); ++i) {
+ for (unsigned i = 0, ie = vRdAllowed->size(); i != ie; ++i) {
unsigned pRd = (*vRdAllowed)[i];
- for (unsigned j = 0; j != vRaAllowed->size(); ++j) {
+ for (unsigned j = 0, je = vRaAllowed->size(); j != je; ++j) {
unsigned pRa = (*vRaAllowed)[j];
if (livesOverlap && TRI->regsOverlap(pRd, pRa))
costs[i + 1][j + 1] = std::numeric_limits<PBQP::PBQPNum>::infinity();
@@ -237,13 +236,13 @@ bool A57PBQPBuilder::addIntraChainConstr
// Enforce minCost(sameParity(RaClass)) > maxCost(otherParity(RdClass))
PBQP::Matrix costs(g.getEdgeCosts(edge));
- for (unsigned i = 0; i != vRdAllowed->size(); ++i) {
+ for (unsigned i = 0, ie = vRdAllowed->size(); i != ie; ++i) {
unsigned pRd = (*vRdAllowed)[i];
// Get the maximum cost (excluding unallocatable reg) for same parity
// registers
PBQP::PBQPNum sameParityMax = std::numeric_limits<PBQP::PBQPNum>::min();
- for (unsigned j = 0; j != vRaAllowed->size(); ++j) {
+ for (unsigned j = 0, je = vRaAllowed->size(); j != je; ++j) {
unsigned pRa = (*vRaAllowed)[j];
if (haveSameParity(pRd, pRa))
if (costs[i + 1][j + 1] !=
@@ -254,7 +253,7 @@ bool A57PBQPBuilder::addIntraChainConstr
// Ensure all registers with a different parity have a higher cost
// than sameParityMax
- for (unsigned j = 0; j != vRaAllowed->size(); ++j) {
+ for (unsigned j = 0, je = vRaAllowed->size(); j != je; ++j) {
unsigned pRa = (*vRaAllowed)[j];
if (!haveSameParity(pRd, pRa))
if (sameParityMax > costs[i + 1][j + 1])
@@ -310,13 +309,13 @@ A57PBQPBuilder::addInterChainConstraint(
// Enforce that cost is higher with all other Chains of the same parity
PBQP::Matrix costs(g.getEdgeCosts(edge));
- for (unsigned i = 0; i != vRdAllowed->size(); ++i) {
+ for (unsigned i = 0, ie = vRdAllowed->size(); i != ie; ++i) {
unsigned pRd = (*vRdAllowed)[i];
// Get the maximum cost (excluding unallocatable reg) for all other
// parity registers
PBQP::PBQPNum sameParityMax = std::numeric_limits<PBQP::PBQPNum>::min();
- for (unsigned j = 0; j != vRrAllowed->size(); ++j) {
+ for (unsigned j = 0, je = vRrAllowed->size(); j != je; ++j) {
unsigned pRa = (*vRrAllowed)[j];
if (!haveSameParity(pRd, pRa))
if (costs[i + 1][j + 1] !=
@@ -327,7 +326,7 @@ A57PBQPBuilder::addInterChainConstraint(
// Ensure all registers with same parity have a higher cost
// than sameParityMax
- for (unsigned j = 0; j != vRrAllowed->size(); ++j) {
+ for (unsigned j = 0, je = vRrAllowed->size(); j != je; ++j) {
unsigned pRa = (*vRrAllowed)[j];
if (haveSameParity(pRd, pRa))
if (sameParityMax > costs[i + 1][j + 1])
More information about the llvm-commits
mailing list