aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2009-09-03 02:52:02 +0000
committerLang Hames <lhames@gmail.com>2009-09-03 02:52:02 +0000
commit3f2f3f5341374c85955cfaffa71886724999762d (patch)
treeffbcbb80b7b5985fe56b523e4f54e6155af65497 /include
parent03a5f139fb7d3e9c49fe95aea4c717fab2285d82 (diff)
downloadexternal_llvm-3f2f3f5341374c85955cfaffa71886724999762d.zip
external_llvm-3f2f3f5341374c85955cfaffa71886724999762d.tar.gz
external_llvm-3f2f3f5341374c85955cfaffa71886724999762d.tar.bz2
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/trunk@80872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetRegisterInfo.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/include/llvm/Target/TargetRegisterInfo.h b/include/llvm/Target/TargetRegisterInfo.h
index 1673c9a..421d0bb 100644
--- a/include/llvm/Target/TargetRegisterInfo.h
+++ b/include/llvm/Target/TargetRegisterInfo.h
@@ -386,9 +386,16 @@ public:
return NumRegs;
}
- /// areAliases - Returns true if the two registers alias each other, false
- /// otherwise
- bool areAliases(unsigned regA, unsigned regB) const {
+ /// regsOverlap - Returns true if the two registers are equal or alias each
+ /// other. The registers may be virtual register.
+ bool regsOverlap(unsigned regA, unsigned regB) const {
+ if (regA == regB)
+ return true;
+
+ if (isVirtualRegister(regA) || isVirtualRegister(regB))
+ return false;
+
+ // regA and regB are distinct physical registers. Do they alias?
size_t index = (regA + regB * 37) & (AliasesHashSize-1);
unsigned ProbeAmt = 0;
while (AliasesHash[index*2] != 0 &&
@@ -403,17 +410,6 @@ public:
return false;
}
- /// regsOverlap - Returns true if the two registers are equal or alias each
- /// other. The registers may be virtual register.
- bool regsOverlap(unsigned regA, unsigned regB) const {
- if (regA == regB)
- return true;
-
- if (isVirtualRegister(regA) || isVirtualRegister(regB))
- return false;
- return areAliases(regA, regB);
- }
-
/// isSubRegister - Returns true if regB is a sub-register of regA.
///
bool isSubRegister(unsigned regA, unsigned regB) const {