[PATCH] D31908: [AntiDepBreaker] Don't rename callee saved register restore instruction

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 15:02:06 PDT 2017


Carrot created this revision.

Current AntiDepBreaker implementation can rename callee saved register restore instruction, and then callee saved register contain garbage value after return.

We should not rename callee saved register restore instruction.


https://reviews.llvm.org/D31908

Files:
  lib/CodeGen/AggressiveAntiDepBreaker.cpp


Index: lib/CodeGen/AggressiveAntiDepBreaker.cpp
===================================================================
--- lib/CodeGen/AggressiveAntiDepBreaker.cpp
+++ lib/CodeGen/AggressiveAntiDepBreaker.cpp
@@ -858,6 +858,10 @@
           // the use if required to break an earlier antidep.
           DEBUG(dbgs() << " (passthru)\n");
           continue;
+        } else if ((RegClassInfo.getLastCalleeSavedAlias(AntiDepReg) != 0) &&
+                   (RegRefs.count(AntiDepReg) == 1)) {
+          // Don't rename callee saved register restore instruction.
+          continue;
         } else {
           // No anti-dep breaking for implicit deps
           MachineOperand *AntiDepOp = MI.findRegisterDefOperand(AntiDepReg);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31908.94744.patch
Type: text/x-patch
Size: 731 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170410/ec767ae3/attachment.bin>


More information about the llvm-commits mailing list