diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-15 11:03:03 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-15 11:03:03 +0000 |
commit | abff8fcb1cd09a2af0a9eaebe7c7f012af275109 (patch) | |
tree | cf8987aa3224404d97171c5e947532cb7b95205b /llvm/lib/CodeGen/VirtRegRewriter.cpp | |
parent | 365ab60d7ae913450a208509c57c59221766a1d1 (diff) | |
download | bcm5719-llvm-abff8fcb1cd09a2af0a9eaebe7c7f012af275109.tar.gz bcm5719-llvm-abff8fcb1cd09a2af0a9eaebe7c7f012af275109.zip |
Update LocalRewriter::DistanceMap when inserting stack loads.
In the included test case, a stack load was not included in DistanceMap. That
caused TransferDeadness to ignore the instruction, leading to a scavenger
assert.
llvm-svn: 79090
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegRewriter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/VirtRegRewriter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/VirtRegRewriter.cpp b/llvm/lib/CodeGen/VirtRegRewriter.cpp index b34d43a1f5d..3e651a57cfe 100644 --- a/llvm/lib/CodeGen/VirtRegRewriter.cpp +++ b/llvm/lib/CodeGen/VirtRegRewriter.cpp @@ -1587,6 +1587,7 @@ private: MachineInstr *LoadMI = prior(InsertLoc); VRM.addSpillSlotUse(SS, LoadMI); ++NumPSpills; + DistanceMap.insert(std::make_pair(LoadMI, Dist++)); } NextMII = next(MII); } @@ -1678,6 +1679,7 @@ private: MachineInstr *LoadMI = prior(InsertLoc); VRM.addSpillSlotUse(SSorRMId, LoadMI); ++NumLoads; + DistanceMap.insert(std::make_pair(LoadMI, Dist++)); } // This invalidates Phys. @@ -1977,6 +1979,7 @@ private: MachineInstr *LoadMI = prior(InsertLoc); VRM.addSpillSlotUse(SSorRMId, LoadMI); ++NumLoads; + DistanceMap.insert(std::make_pair(LoadMI, Dist++)); } // This invalidates PhysReg. Spills.ClobberPhysReg(PhysReg); |