[llvm] [SelectionDAG] Pass SDValue to InstrEmitter::EmitCopyFromReg. NFC (PR #153485)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 13 13:20:10 PDT 2025


================
@@ -118,10 +115,8 @@ void InstrEmitter::EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone,
         Match = false;
     } else {
       for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) {
-        SDValue Op = User->getOperand(i);
-        if (Op.getNode() != Node || Op.getResNo() != ResNo)
+        if (User->getOperand(i) != Op)
           continue;
-        MVT VT = Node->getSimpleValueType(Op.getResNo());
----------------
topperc wrote:

I remove this VT variable because it should be the same as the VT outside the loop. Op.getResNo() here is the same as ResNo due the previous `if`. The ResNo check was not in the previous `if` when this line was originally written. I think it should be impossible for VT to ever be Other or Glue here but removing that check as out of scope for this patch.

https://github.com/llvm/llvm-project/pull/153485


More information about the llvm-commits mailing list