[llvm] Implement the trampoline intrinsics for AIX. (PR #149388)

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 09:45:49 PDT 2025


================
@@ -3985,16 +3982,73 @@ SDValue PPCTargetLowering::LowerINLINEASM(SDValue Op, SelectionDAG &DAG) const {
 
 SDValue PPCTargetLowering::LowerINIT_TRAMPOLINE(SDValue Op,
                                                 SelectionDAG &DAG) const {
-  if (Subtarget.isAIXABI())
-    report_fatal_error("INIT_TRAMPOLINE operation is not supported on AIX.");
-
   SDValue Chain = Op.getOperand(0);
   SDValue Trmp = Op.getOperand(1); // trampoline
   SDValue FPtr = Op.getOperand(2); // nested function
   SDValue Nest = Op.getOperand(3); // 'nest' parameter value
   SDLoc dl(Op);
 
   EVT PtrVT = getPointerTy(DAG.getDataLayout());
+
+  if (Subtarget.isAIXABI()) {
+    // On AIX we create a trampoline descriptor by combining the
+    // entry point and TOC from the global descriptor (FPtr) with the
+    // nest argument as the environement pointer.
----------------
amy-kwan wrote:

```suggestion
    // nest argument as the environment pointer.
```

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


More information about the llvm-commits mailing list