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

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 11:23:09 PDT 2018


junbuml 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;
----------------
thegameg wrote:
> 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.
I see what you mean. I will change it to keep only operand idx and get the register using MI.getOperand(OpIdx).getReg() .


https://reviews.llvm.org/D44958





More information about the llvm-commits mailing list