[PATCH] D59565: Allow machine dce to remove uses in the same instruction

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 14:58:50 PDT 2019


arsenm added inline comments.


================
Comment at: lib/CodeGen/DeadMachineInstructionElim.cpp:84-85
       } else {
-        if (!MRI->use_nodbg_empty(Reg))
-          // This def has a non-debug use. Don't delete the instruction!
-          return false;
+        for (const MachineOperand &MO : MRI->use_nodbg_operands(Reg)) {
+          if (MO.getParent() != MI)
+            // This def has a non-debug use. Don't delete the instruction!
----------------
This needs a search limit in case of huge numbers of uses?
This can also use use_nodbg_instructions


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

https://reviews.llvm.org/D59565





More information about the llvm-commits mailing list