<div dir="ltr"><div><div><div>Unfortunately our backend is not yet in experimental. I think AArch64 LowerCall is representative.<br><br>  // Build a sequence of copy-to-reg nodes chained together with token chain<br>  // and flag operands which copy the outgoing args into the appropriate regs.<br>  SDValue InFlag;<br>  for (auto &RegToPass : RegsToPass) {<br>    Chain = DAG.getCopyToReg(Chain, DL, RegToPass.first,<br>                             RegToPass.second, InFlag);<br>    InFlag = Chain.getValue(1);<br>  }<br><br></div>I have two questions about this. Primarily, what is the purpose of threading InFlag through the copyToReg nodes? It seems to be a common choice across multiple backends.<br><br></div>My understanding is that glue nodes are used to "stick" other nodes together, increasing the probability that they end up near each other at scheduling. I think that would make them optional in the sense that codegen would be correct in their absence. If so, I would like to remove them from our backend as the scheduler will probably do a reasonable job without hints.<br><br></div><div>The second query is whether each copy needs to be dependent on the previous argument. I expected each copy to take the same chain node, with the the chain nodes returned by getCopyToReg merged using a TokenFactor. The goal would be to allow the register allocator / scheduler to rearrange the instructions used to pass arguments.<br><br></div><div>If each copy can indeed be passed the same chain node to indicate that they are independent of one another then I should be able to get better codegen out of the register allocator.<br><br></div><div>Thanks!<br><br></div><div>Jon<br></div><div><br></div><br></div>