[PATCH] D42200: Fix RegScavenger::unprocess

David Greene via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 14:51:02 PST 2018


greened created this revision.
greened added reviewers: MatzeB, silviu.baranga, kparzysz.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D42200

Files:
  lib/CodeGen/RegisterScavenging.cpp


Index: lib/CodeGen/RegisterScavenging.cpp
===================================================================
--- lib/CodeGen/RegisterScavenging.cpp
+++ lib/CodeGen/RegisterScavenging.cpp
@@ -162,8 +162,8 @@
     determineKillsAndDefs();
 
     // Commit the changes.
-    setUsed(KillRegUnits);
     setUnused(DefRegUnits);
+    setUsed(KillRegUnits);
   }
 
   if (MBBI == MBB->begin()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42200.130279.patch
Type: text/x-patch
Size: 391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180117/6deb0730/attachment.bin>


More information about the llvm-commits mailing list