[llvm] RFC: [AMDGPU] Select CONVERGENCECTRL_GLUE generically (PR #87509)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 04:40:11 PDT 2024


arsenm wrote:

> Would you be happier with this if there was some assertion (in tablegen, or generic selectiondag, or the AMDGPU backend) that all convergent SDNodes are marked with SDNPInGlue/SDNPOptInGlue?

This sounds good to me 

> Ok. What I am inferring here is that there is at most one glue operand on an instruction, and if multiple nodes need to be glued, they need to be chained (with more glue) to the same operand. This one operand will be preserved with the right properties, and then those glued nodes will be translated by the usual rules. Is that correct?

This was always my understanding of glue. It's a chain of glue 

> The counter-example would be the glue operand on the SI_CALL/SI_TCRETURN family of instructions. Currently, the glue operand is a chain of outgoing arguments at the callsite. When I tried to append the token to that chain, it produced errors in the selection process. But then I just appended a second glue operand just for the token, and that seemed to work. I also put a comment in there explaining my assumptions. Maybe that was the wrong way to go about it?

The call and tcreturn cases are quite different. The call is essentially a regular instruction, but the return is the end of the dag. What kind of errors? 


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


More information about the llvm-commits mailing list