llvm.org GIT mirror llvm / 20647a5
Add RegisterDefIsDead to correspond to KillsRegister, mark both const git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22987 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
1 changed file(s) with 14 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
126126
127127 /// KillsRegister - Return true if the specified instruction kills the
128128 /// specified register.
129 bool KillsRegister(MachineInstr *MI, unsigned Reg) {
130 std::pair KIP = killed_range(MI);
129 bool KillsRegister(MachineInstr *MI, unsigned Reg) const {
130 typedef std::multimap::const_iterator cki;
131 std::pair KIP = RegistersKilled.equal_range(MI);
131132 for (; KIP.first != KIP.second; ++KIP.first)
132133 if (KIP.first->second == Reg)
133134 return true;
143144 std::pair
144145 dead_range(MachineInstr *MI) {
145146 return RegistersDead.equal_range(MI);
147 }
148
149 /// RegisterDefIsDead - Return true if the specified instruction defines the
150 /// specified register, but that definition is dead.
151 bool RegisterDefIsDead(MachineInstr *MI, unsigned Reg) const {
152 typedef std::multimap::const_iterator cki;
153 std::pair KIP = RegistersDead.equal_range(MI);
154 for (; KIP.first != KIP.second; ++KIP.first)
155 if (KIP.first->second == Reg)
156 return true;
157 return false;
146158 }
147159
148160 //===--------------------------------------------------------------------===//