[PATCH] D44958: [PostRASink]Add register dependency check for implicit operands

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 11:02:12 PDT 2018


thegameg added inline comments.


================
Comment at: lib/CodeGen/MachineSink.cpp:1126
 
-    unsigned DefReg = MI->getOperand(0).getReg();
-    unsigned SrcReg = MI->getOperand(1).getReg();
+    SmallVector<std::pair<unsigned, unsigned>, 2> UsedRegsInCopy;
+    SmallVector<unsigned, 2> DefedRegsInCopy;
----------------
junbuml wrote:
> thegameg wrote:
> > Any particular reason why we need to store both the register and the operand idx?
> The operand idx will be used in clearKillFlags() to set the kill flag in src reg of the Copy sunk if the src reg is killed in an instruction placed between Copy and the end of the block.
Right, I was just curious why not only use the operand idx and use MI.getOperand(OpIdx).getReg() to retrieve the register.


https://reviews.llvm.org/D44958





More information about the llvm-commits mailing list