llvm.org GIT mirror llvm / 2c925e0
[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 Arnaud A. de Grandmaison 6 years ago
1 changed file(s) with 10 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
3030 #include "llvm/Support/raw_ostream.h"
3131
3232 #define PBQP_BUILDER PBQPBuilderWithCoalescing
33 //#define PBQP_BUILDER PBQPBuilder
3433
3534 using namespace llvm;
3635
194193 return false;
195194
196195 if (isPhysicalReg(Rd) || isPhysicalReg(Ra)) {
197 dbgs() << "Rd is a physical reg:" << isPhysicalReg(Rd) << '\n';
198 dbgs() << "Ra is a physical reg:" << isPhysicalReg(Ra) << '\n';
196 DEBUG(dbgs() << "Rd is a physical reg:" << isPhysicalReg(Rd) << '\n');
197 DEBUG(dbgs() << "Ra is a physical reg:" << isPhysicalReg(Ra) << '\n');
199198 return false;
200199 }
201200
215214 bool livesOverlap = ld.overlaps(la);
216215
217216 PBQP::Matrix costs(vRdAllowed->size() + 1, vRaAllowed->size() + 1, 0);
218 for (unsigned i = 0; i != vRdAllowed->size(); ++i) {
217 for (unsigned i = 0, ie = vRdAllowed->size(); i != ie; ++i) {
219218 unsigned pRd = (*vRdAllowed)[i];
220 for (unsigned j = 0; j != vRaAllowed->size(); ++j) {
219 for (unsigned j = 0, je = vRaAllowed->size(); j != je; ++j) {
221220 unsigned pRa = (*vRaAllowed)[j];
222221 if (livesOverlap && TRI->regsOverlap(pRd, pRa))
223222 costs[i + 1][j + 1] = std::numeric_limits::infinity();
236235
237236 // Enforce minCost(sameParity(RaClass)) > maxCost(otherParity(RdClass))
238237 PBQP::Matrix costs(g.getEdgeCosts(edge));
239 for (unsigned i = 0; i != vRdAllowed->size(); ++i) {
238 for (unsigned i = 0, ie = vRdAllowed->size(); i != ie; ++i) {
240239 unsigned pRd = (*vRdAllowed)[i];
241240
242241 // Get the maximum cost (excluding unallocatable reg) for same parity
243242 // registers
244243 PBQP::PBQPNum sameParityMax = std::numeric_limits::min();
245 for (unsigned j = 0; j != vRaAllowed->size(); ++j) {
244 for (unsigned j = 0, je = vRaAllowed->size(); j != je; ++j) {
246245 unsigned pRa = (*vRaAllowed)[j];
247246 if (haveSameParity(pRd, pRa))
248247 if (costs[i + 1][j + 1] !=
253252
254253 // Ensure all registers with a different parity have a higher cost
255254 // than sameParityMax
256 for (unsigned j = 0; j != vRaAllowed->size(); ++j) {
255 for (unsigned j = 0, je = vRaAllowed->size(); j != je; ++j) {
257256 unsigned pRa = (*vRaAllowed)[j];
258257 if (!haveSameParity(pRd, pRa))
259258 if (sameParityMax > costs[i + 1][j + 1])
309308
310309 // Enforce that cost is higher with all other Chains of the same parity
311310 PBQP::Matrix costs(g.getEdgeCosts(edge));
312 for (unsigned i = 0; i != vRdAllowed->size(); ++i) {
311 for (unsigned i = 0, ie = vRdAllowed->size(); i != ie; ++i) {
313312 unsigned pRd = (*vRdAllowed)[i];
314313
315314 // Get the maximum cost (excluding unallocatable reg) for all other
316315 // parity registers
317316 PBQP::PBQPNum sameParityMax = std::numeric_limits::min();
318 for (unsigned j = 0; j != vRrAllowed->size(); ++j) {
317 for (unsigned j = 0, je = vRrAllowed->size(); j != je; ++j) {
319318 unsigned pRa = (*vRrAllowed)[j];
320319 if (!haveSameParity(pRd, pRa))
321320 if (costs[i + 1][j + 1] !=
326325
327326 // Ensure all registers with same parity have a higher cost
328327 // than sameParityMax
329 for (unsigned j = 0; j != vRrAllowed->size(); ++j) {
328 for (unsigned j = 0, je = vRrAllowed->size(); j != je; ++j) {
330329 unsigned pRa = (*vRrAllowed)[j];
331330 if (haveSameParity(pRd, pRa))
332331 if (sameParityMax > costs[i + 1][j + 1])