[PATCH] D18508: Replace at most one dead register with zero register on aarch64

Yichao Yu via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 27 20:59:58 PDT 2016


yuyichao created this revision.
yuyichao added a reviewer: t.p.northover.
yuyichao added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.

Fix https://llvm.org/bugs/show_bug.cgi?id=27081

As mentioned in my comment of the bug report, this seems to be fix the problem but it does make a few assumptions. This is currently assuming that no live dest can be zero register before this pass and there shouldn't be more than one dead register in other instructions.

I searched through the aarch64 instruction set manual and it seems that the load pair instructions are the only ones that can cause this trouble so maybe it is best to just check for those.


http://reviews.llvm.org/D18508

Files:
  lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp

Index: lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp
===================================================================
--- lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp
+++ lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp
@@ -123,6 +123,8 @@
         MO.setReg(NewReg);
         DEBUG(MI.print(dbgs()));
         ++NumDeadDefsReplaced;
+        // Only replace one dead register
+        break;
       }
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18508.51769.patch
Type: text/x-patch
Size: 451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160328/6799bed6/attachment.bin>


More information about the llvm-commits mailing list