[PATCH] D39044: [MachineRegisterInfo] Avoid having dbg.values affect code generation

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 04:18:52 PDT 2017


uabelho created this revision.

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.


https://reviews.llvm.org/D39044

Files:
  lib/CodeGen/MachineRegisterInfo.cpp


Index: lib/CodeGen/MachineRegisterInfo.cpp
===================================================================
--- lib/CodeGen/MachineRegisterInfo.cpp
+++ lib/CodeGen/MachineRegisterInfo.cpp
@@ -428,8 +428,8 @@
   // 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39044.119454.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171018/20c121be/attachment.bin>


More information about the llvm-commits mailing list