[PATCH] D15157: CodeGen peephole: fold redundant phys reg copies

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 15:28:09 PST 2015


jfb marked an inline comment as done.
jfb added a comment.

Comments addressed.


================
Comment at: lib/CodeGen/PeepholeOptimizer.cpp:1537
@@ +1536,3 @@
+      if (!MI->isCopy()) {
+        for (const auto &Op : MI->operands()) {
+          // Visit all operands: definitions can be implicit or explicit.
----------------
qcolombet wrote:
> I’ll make a function out of it and you have to check the reg mask operand as well.
> For instance, if we have a pure (side effect free) function call, you may clobber the register and we will miss it.
I added regmask.

I'm not sure I understand what you mean with "pure". Do you mean `readonly`? That still has to observe the calling convention and declare its clobbers, no?


http://reviews.llvm.org/D15157





More information about the llvm-commits mailing list