[PATCH] D138757: [zero-call-used-regs] Mark only non-debug instruction's register as used

Shivam Gupta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 21:04:57 PST 2022


xgupta updated this revision to Diff 478128.
xgupta added a comment.

address comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138757/new/

https://reviews.llvm.org/D138757

Files:
  llvm/lib/CodeGen/PrologEpilogInserter.cpp


Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp
===================================================================
--- llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -1230,6 +1230,10 @@
   if (OnlyUsed)
     for (const MachineBasicBlock &MBB : MF)
       for (const MachineInstr &MI : MBB)
+         // skip debug instructions
+         if (MI.isDebugInstr())
+           continue;
+
         for (const MachineOperand &MO : MI.operands()) {
           if (!MO.isReg())
             continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138757.478128.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221128/dc1683b6/attachment.bin>


More information about the llvm-commits mailing list