[llvm-branch-commits] [llvm] Add IR and codegen support for deactivation symbols. (PR #133536)

Peter Collingbourne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 25 22:18:53 PST 2025


================
@@ -1221,15 +1225,23 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
     }
   }
 
-  if (SDNode *GluedNode = Node->getGluedNode()) {
-    // FIXME: Possibly iterate over multiple glue nodes?
-    if (GluedNode->getOpcode() ==
-        ~(unsigned)TargetOpcode::CONVERGENCECTRL_GLUE) {
-      Register VReg = getVR(GluedNode->getOperand(0), VRBaseMap);
-      MachineOperand MO = MachineOperand::CreateReg(VReg, /*isDef=*/false,
-                                                    /*isImp=*/true);
-      MIB->addOperand(MO);
-    }
+  unsigned Op = Node->getNumOperands();
+  if (Op != 0 && Node->getOperand(Op - 1)->getOpcode() ==
+                     ~(unsigned)TargetOpcode::CONVERGENCECTRL_GLUE) {
+    Register VReg = getVR(Node->getOperand(Op - 1)->getOperand(0), VRBaseMap);
+    MachineOperand MO = MachineOperand::CreateReg(VReg, /*isDef=*/false,
+                                                  /*isImp=*/true);
+    MIB->addOperand(MO);
+    Op--;
+  }
+
+  if (Op != 0 &&
----------------
pcc wrote:

That should be possible. We handle it by decrementing `Op` in the code that handles `CONVERGENCECTRL_GLUE`. This means that `DEACTIVATION_SYMBOL` and `CONVERGENCECTRL_GLUE` have to appear in that order. The function `SelectionDAGBuilder::getTargetIntrinsicOperands` takes care of that.

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


More information about the llvm-branch-commits mailing list