diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-05-24 21:33:37 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-05-24 21:33:37 +0000 |
commit | 1b79babdecf775b03ed6c347c75fa05588ed9c65 (patch) | |
tree | 0f21b91dcc790845c05789bb673f6f8653676e9c /llvm/lib/CodeGen/MachineRegisterInfo.cpp | |
parent | 79b6a0f140157300b4be158178837313e3d6f592 (diff) | |
download | bcm5719-llvm-1b79babdecf775b03ed6c347c75fa05588ed9c65.tar.gz bcm5719-llvm-1b79babdecf775b03ed6c347c75fa05588ed9c65.zip |
Avoid adding duplicate function live-in's.
llvm-svn: 104560
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineRegisterInfo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp index 402be479eac..70bf7e5da5e 100644 --- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp +++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp @@ -165,6 +165,15 @@ unsigned MachineRegisterInfo::getLiveInPhysReg(unsigned VReg) const { return 0; } +/// getLiveInVirtReg - If PReg is a live-in physical register, return the +/// corresponding live-in physical register. +unsigned MachineRegisterInfo::getLiveInVirtReg(unsigned PReg) const { + for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I) + if (I->first == PReg) + return I->second; + return 0; +} + static cl::opt<bool> SchedLiveInCopies("schedule-livein-copies", cl::Hidden, cl::desc("Schedule copies of livein registers"), |