[llvm] [AMDGPU] ISel for @llvm.amdgcn.cs.chain intrinsic (PR #68186)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 10:47:30 PDT 2023


================
@@ -116,6 +117,19 @@ static void splitBlock(MachineBasicBlock &MBB, MachineInstr &MI,
   MDT->getBase().applyUpdates(DTUpdates);
 }
 
+void SILateBranchLowering::expandChainCall(MachineInstr &MI) {
+  // This is a tail call that needs to be expanded into at least
+  // 2 instructions, one for setting EXEC and one for the actual tail call.
+  constexpr unsigned ExecIdx = 3;
+
+  auto SetExec =
+      BuildMI(*MI.getParent(), MI, MI.getDebugLoc(), TII->get(MovOpc), ExecReg);
+  SetExec->addOperand(MI.getOperand(ExecIdx));
----------------
jayfoad wrote:

Could write this as `BuildMI(...).add(...);` Then there is no need for `SetExec`.

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


More information about the llvm-commits mailing list