regpressure: Fix getMaxUpwardPressureDelta.

llvm-svn: 157004
This commit is contained in:
Andrew Trick 2012-05-17 18:35:05 +00:00
parent 463b2f1f04
commit 1c646ac68b
1 changed files with 6 additions and 2 deletions

View File

@ -629,13 +629,17 @@ getMaxUpwardPressureDelta(const MachineInstr *MI, RegPressureDelta &Delta) {
// Generate liveness for uses.
for (unsigned i = 0, e = PhysRegOpers.Uses.size(); i < e; ++i) {
unsigned Reg = PhysRegOpers.Uses[i];
if (!hasRegAlias(Reg, LivePhysRegs, TRI)) {
if (!hasRegAlias(Reg, LivePhysRegs, TRI)
&& (findRegAlias(Reg, PhysRegOpers.Defs, TRI)
== PhysRegOpers.Defs.end())) {
increasePhysRegPressure(Reg);
}
}
for (unsigned i = 0, e = VirtRegOpers.Uses.size(); i < e; ++i) {
unsigned Reg = VirtRegOpers.Uses[i];
if (!LiveVirtRegs.count(Reg)) {
if (!LiveVirtRegs.count(Reg)
&& (std::find(VirtRegOpers.Defs.begin(), VirtRegOpers.Defs.end(), Reg)
!= VirtRegOpers.Defs.end())) {
increaseVirtRegPressure(Reg);
}
}