[llvm] r337735 - Fix RegScavenger::unprocess
David Greene via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 23 13:23:51 PDT 2018
Author: greened
Date: Mon Jul 23 13:23:50 2018
New Revision: 337735
URL: http://llvm.org/viewvc/llvm-project?rev=337735&view=rev
Log:
Fix RegScavenger::unprocess
RegScavenger::unprocess walks backward, so it should undo the effects
of defs before undoing effects of kills. Previously it did things in
the opposite order, leaving a register apparently unused (dead) in the
case where an instruction both used (killed) and defined a register.
Differential Revision: https://reviews.llvm.org/D42200
Modified:
llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterScavenging.cpp?rev=337735&r1=337734&r2=337735&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterScavenging.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Mon Jul 23 13:23:50 2018
@@ -162,8 +162,8 @@ void RegScavenger::unprocess() {
determineKillsAndDefs();
// Commit the changes.
- setUsed(KillRegUnits);
setUnused(DefRegUnits);
+ setUsed(KillRegUnits);
}
if (MBBI == MBB->begin()) {
More information about the llvm-commits
mailing list