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 | |
parent | 686240a97eb3ff45545300c8417c38689551a176 (diff) | |
download | bcm5719-llvm-1dd82dd3fc608ee600652a8bf34f6c345354e3b0.tar.gz bcm5719-llvm-1dd82dd3fc608ee600652a8bf34f6c345354e3b0.zip |
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')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocPBQP.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegAllocPBQP.cpp b/llvm/lib/CodeGen/RegAllocPBQP.cpp index 24442d7676f..cdd92afe8a0 100644 --- a/llvm/lib/CodeGen/RegAllocPBQP.cpp +++ b/llvm/lib/CodeGen/RegAllocPBQP.cpp @@ -526,7 +526,7 @@ void RegAllocPBQP::finalizeAlloc() const { itr != end; ++itr) { LiveInterval *li = &lis->getInterval(*itr); - unsigned physReg = vrm->getRegAllocPref(li->reg); + unsigned physReg = mri->getSimpleHint(li->reg); if (physReg == 0) { const TargetRegisterClass *liRC = mri->getRegClass(li->reg); diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index dcfad664145..820eed083b7 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)) |