[llvm] [win][x64] Guarantee shape of tail call to a control flow guard function (PR #174108)

Daniel Paoliello via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 2 15:28:00 PST 2026


================
@@ -373,6 +375,16 @@ bool X86ExpandPseudoImpl::expandMI(MachineBasicBlock &MBB,
       BuildMI(MBB, MBBI, DL,
               TII->get(IsX64 ? X86::TAILJMPr64_REX : X86::TAILJMPr64))
           .add(JumpTarget);
+    } else if (Opcode == X86::TCRETURNmi64_GlobalAddr) {
+      assert(IsX64 &&
+             "TCRETURNmi_GlobalAddr is currently only supported on x64");
+      BuildMI(MBB, MBBI, DL, TII->get(X86::TAILJMPm64_REX))
----------------
dpaoliello wrote:

Spent some time to learn more about TableGen, and now I've removed the psuedo-instructions and replaced them with pattern matching instead - much nicer, thanks for the tip!

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


More information about the llvm-commits mailing list