llvm.org GIT mirror llvm / beabacc
Merge 80872 from mainline. Fixed a test that ensures the LocalRewriter does not attempt to avoid reloads by reusing clobbered registers. This was causing issues in 256.bzip2 when compiled with PIC for a while (starting at r78217), though the problem has since been masked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@81032 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
3 changed file(s) with 12 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
385385 return NumRegs;
386386 }
387387
388 /// areAliases - Returns true if the two registers alias each other, false
389 /// otherwise
390 bool areAliases(unsigned regA, unsigned regB) const {
388 /// regsOverlap - Returns true if the two registers are equal or alias each
389 /// other. The registers may be virtual register.
390 bool regsOverlap(unsigned regA, unsigned regB) const {
391 if (regA == regB)
392 return true;
393
394 if (isVirtualRegister(regA) || isVirtualRegister(regB))
395 return false;
396
397 // regA and regB are distinct physical registers. Do they alias?
391398 size_t index = (regA + regB * 37) & (AliasesHashSize-1);
392399 unsigned ProbeAmt = 0;
393400 while (AliasesHash[index*2] != 0 &&
400407 }
401408
402409 return false;
403 }
404
405 /// regsOverlap - Returns true if the two registers are equal or alias each
406 /// other. The registers may be virtual register.
407 bool regsOverlap(unsigned regA, unsigned regB) const {
408 if (regA == regB)
409 return true;
410
411 if (isVirtualRegister(regA) || isVirtualRegister(regB))
412 return false;
413 return areAliases(regA, regB);
414410 }
415411
416412 /// isSubRegister - Returns true if regB is a sub-register of regA.
268268 unsigned reg2 = *a2Itr;
269269
270270 // If the row/column regs are identical or alias insert an infinity.
271 if ((reg1 == reg2) || tri->areAliases(reg1, reg2)) {
271 if (tri->regsOverlap(reg1, reg2)) {
272272 (*m)[ri][ci] = std::numeric_limits::infinity();
273273 isZeroMatrix = false;
274274 }
789789 // value aliases the new register. If so, codegen the previous reload
790790 // and use this one.
791791 unsigned PRRU = Op.PhysRegReused;
792 if (TRI->areAliases(PRRU, PhysReg)) {
792 if (TRI->regsOverlap(PRRU, PhysReg)) {
793793 // Okay, we found out that an alias of a reused register
794794 // was used. This isn't good because it means we have
795795 // to undo a previous reuse.