[llvm] r318382 - [MachineRegisterInfo] Avoid having dbg.values affect code generation

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 23:01:23 PST 2017


Author: uabelho
Date: Wed Nov 15 23:01:23 2017
New Revision: 318382

URL: http://llvm.org/viewvc/llvm-project?rev=318382&view=rev
Log:
[MachineRegisterInfo] Avoid having dbg.values affect code generation

Summary:
Use use_nodbg_empty() rather than use_empty() in
MachineRegisterInfo::EmitLiveInCopies() when determining if a livein
register has any uses or not. Otherwise a single dbg.value can make us
generate different code, meaning -g would affect code generation.

Found when compiling code for my out-of-tree target. Unfortunately I
haven't been able to reproduce the problem on X86 or any of the other
in-tree targets that I tried, so no test case.

Reviewers: MatzeB

Reviewed By: MatzeB

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39044

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

Modified: llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp?rev=318382&r1=318381&r2=318382&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineRegisterInfo.cpp Wed Nov 15 23:01:23 2017
@@ -428,8 +428,8 @@ MachineRegisterInfo::EmitLiveInCopies(Ma
   // Emit the copies into the top of the block.
   for (unsigned i = 0, e = LiveIns.size(); i != e; ++i)
     if (LiveIns[i].second) {
-      if (use_empty(LiveIns[i].second)) {
-        // The livein has no uses. Drop it.
+      if (use_nodbg_empty(LiveIns[i].second)) {
+        // The livein has no non-dbg uses. Drop it.
         //
         // It would be preferable to have isel avoid creating live-in
         // records for unused arguments in the first place, but it's




More information about the llvm-commits mailing list