mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-17 23:20:20 +00:00
Add RegisterDefIsDead to correspond to KillsRegister, mark both const
llvm-svn: 22987
This commit is contained in:
parent
610eeca969
commit
f91a79a306
@ -127,8 +127,9 @@ public:
|
||||
|
||||
/// KillsRegister - Return true if the specified instruction kills the
|
||||
/// specified register.
|
||||
bool KillsRegister(MachineInstr *MI, unsigned Reg) {
|
||||
std::pair<killed_iterator, killed_iterator> KIP = killed_range(MI);
|
||||
bool KillsRegister(MachineInstr *MI, unsigned Reg) const {
|
||||
typedef std::multimap<MachineInstr*, unsigned>::const_iterator cki;
|
||||
std::pair<cki, cki> KIP = RegistersKilled.equal_range(MI);
|
||||
for (; KIP.first != KIP.second; ++KIP.first)
|
||||
if (KIP.first->second == Reg)
|
||||
return true;
|
||||
@ -145,6 +146,17 @@ public:
|
||||
dead_range(MachineInstr *MI) {
|
||||
return RegistersDead.equal_range(MI);
|
||||
}
|
||||
|
||||
/// RegisterDefIsDead - Return true if the specified instruction defines the
|
||||
/// specified register, but that definition is dead.
|
||||
bool RegisterDefIsDead(MachineInstr *MI, unsigned Reg) const {
|
||||
typedef std::multimap<MachineInstr*, unsigned>::const_iterator cki;
|
||||
std::pair<cki, cki> KIP = RegistersDead.equal_range(MI);
|
||||
for (; KIP.first != KIP.second; ++KIP.first)
|
||||
if (KIP.first->second == Reg)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// API to update live variable information
|
||||
|
Loading…
x
Reference in New Issue
Block a user