diff options
author | Quentin Colombet <qcolombet@apple.com> | 2017-08-21 22:56:18 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2017-08-21 22:56:18 +0000 |
commit | 4056e80719317ec1719dde7c2b08d1720a4ad2a4 (patch) | |
tree | 1fe6ed478506208c0f095f673e39a56209fdd032 /llvm/lib/CodeGen/RegAllocBasic.cpp | |
parent | 7227ebad9cc6775ee63656315811b8233cf28085 (diff) | |
download | bcm5719-llvm-4056e80719317ec1719dde7c2b08d1720a4ad2a4.tar.gz bcm5719-llvm-4056e80719317ec1719dde7c2b08d1720a4ad2a4.zip |
[RegAlloc] Make sure live-ranges reflect the state of the IR when removing them
When removing a live-range we used to not touch them making debug
prints harder to read because the IR was not matching what the
live-ranges information was saying.
This only affects debug printing and allows to put stronger asserts in
the code (see r308906 for instance).
llvm-svn: 311401
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBasic.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocBasic.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp index 774306154a8..5ecde0c9d9f 100644 --- a/llvm/lib/CodeGen/RegAllocBasic.cpp +++ b/llvm/lib/CodeGen/RegAllocBasic.cpp @@ -143,14 +143,17 @@ INITIALIZE_PASS_END(RABasic, "regallocbasic", "Basic Register Allocator", false, false) bool RABasic::LRE_CanEraseVirtReg(unsigned VirtReg) { + LiveInterval &LI = LIS->getInterval(VirtReg); if (VRM->hasPhys(VirtReg)) { - LiveInterval &LI = LIS->getInterval(VirtReg); Matrix->unassign(LI); aboutToRemoveInterval(LI); return true; } // Unassigned virtreg is probably in the priority queue. // RegAllocBase will erase it after dequeueing. + // Nonetheless, clear the live-range so that the debug + // dump will show the right state for that VirtReg. + LI.clear(); return false; } |