[llvm] r321571 - [MachineOperand] Fix LiveDebugVariables code after isRenamable change.

Geoff Berry via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 13:01:09 PST 2017


Author: gberry
Date: Fri Dec 29 13:01:09 2017
New Revision: 321571

URL: http://llvm.org/viewvc/llvm-project?rev=321571&view=rev
Log:
[MachineOperand] Fix LiveDebugVariables code after isRenamable change.

Fix code in LiveDebugVariables that was changing def MachineOperands to
uses, which will hit an assert for dead operands after the change to add
the renamable bit to MachineOperands.  Avoid the assert by clearing the
dead bit before changing the operand to a use.

Fixes issue reported in out of tree target by Jesper Antonsson at Ericsson.

Modified:
    llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp

Modified: llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp?rev=321571&r1=321570&r2=321571&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp Fri Dec 29 13:01:09 2017
@@ -242,8 +242,11 @@ public:
     // We are storing a MachineOperand outside a MachineInstr.
     locations.back().clearParent();
     // Don't store def operands.
-    if (locations.back().isReg())
+    if (locations.back().isReg()) {
+      if (locations.back().isDef())
+        locations.back().setIsDead(false);
       locations.back().setIsUse();
+    }
     return locations.size() - 1;
   }
 




More information about the llvm-commits mailing list