[PATCH] D114795: [PR52475] Ensure a correct chain in copies to/from hidden sret parameter

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 00:46:15 PST 2021


frasercrmck marked an inline comment as done.
frasercrmck added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1924
 
-    SDValue RetPtr = DAG.getCopyFromReg(DAG.getEntryNode(), getCurSDLoc(),
-                                        DemoteReg, PtrValueVTs[0]);
+    SDValue RetPtr = DAG.getCopyFromReg(DAG.getRoot(), getCurSDLoc(), DemoteReg,
+                                        PtrValueVTs[0]);
----------------
craig.topper wrote:
> Is there any difference if we use the local Chain variable here. I think getControlRoot should ensure DAG.getRoot is in sync with the Chain returned.
Doesn't seem like there's any difference. `getControlRoot` looks right, as you say, and it feels better to me to use the local Chain variable. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114795/new/

https://reviews.llvm.org/D114795



More information about the llvm-commits mailing list