diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-12-04 00:30:22 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-12-04 00:30:22 +0000 |
commit | 1dd82dd3fc608ee600652a8bf34f6c345354e3b0 (patch) | |
tree | fc951aa594289317218c432eda03c2714738bd79 /llvm/lib/CodeGen/VirtRegMap.cpp | |
parent | 686240a97eb3ff45545300c8417c38689551a176 (diff) | |
download | llvm-1dd82dd3fc608ee600652a8bf34f6c345354e3b0.zip llvm-1dd82dd3fc608ee600652a8bf34f6c345354e3b0.tar.gz llvm-1dd82dd3fc608ee600652a8bf34f6c345354e3b0.tar.bz2 |
Use MRI::getSimpleHint() instead of getRegAllocPref() in remaining cases.
Targets can provide multiple hints now, so getRegAllocPref() doesn't
make sense any longer because it only returns one preferred register.
Replace it with getSimpleHint() in the remaining heuristics. This
function only
llvm-svn: 169188
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp')
-rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index dcfad664..820eed0 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -88,6 +88,15 @@ unsigned VirtRegMap::getRegAllocPref(unsigned virtReg) { return TRI->ResolveRegAllocHint(Hint.first, physReg, *MF); } +bool VirtRegMap::hasPreferredPhys(unsigned VirtReg) { + unsigned Hint = MRI->getSimpleHint(VirtReg); + if (!Hint) + return 0; + if (TargetRegisterInfo::isVirtualRegister(Hint)) + Hint = getPhys(Hint); + return getPhys(VirtReg) == Hint; +} + bool VirtRegMap::hasKnownPreference(unsigned VirtReg) { std::pair<unsigned, unsigned> Hint = MRI->getRegAllocationHint(VirtReg); if (TargetRegisterInfo::isPhysicalRegister(Hint.second)) |