From: Arnaud A. de Grandmaison Date: Wed, 10 Sep 2014 17:03:25 +0000 (+0000) Subject: [AArch64] Address Chad's post commit review comments for r217504 (PBQP experimental... X-Git-Tag: android-x86-7.1-r4~57676 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2c925e0e8fdb3a2f37d055fe58bc65984bfac260;p=android-x86%2Fexternal-llvm.git [AArch64] Address Chad's post commit review comments for r217504 (PBQP experimental support) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217518 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp b/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp index 87e3502c9aa..28992bbed0b 100644 --- a/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp +++ b/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp @@ -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::addIntraChainConstraint(PBQPRAProblem *p, unsigned Rd, 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::addIntraChainConstraint(PBQPRAProblem *p, unsigned Rd, 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::infinity(); @@ -237,13 +236,13 @@ bool A57PBQPBuilder::addIntraChainConstraint(PBQPRAProblem *p, unsigned Rd, // 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::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::addIntraChainConstraint(PBQPRAProblem *p, unsigned Rd, // 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(PBQPRAProblem *p, unsigned Rd, // 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::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(PBQPRAProblem *p, unsigned Rd, // 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])