[clang] [flang] [llvm] [flang] Add runtime trampoline pool for W^X compliance (PR #183108)

Peter Klausler via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 07:48:09 PST 2026


klausler wrote:

What's the before/after performance difference?

```
module m1
  integer, parameter :: iters = 10000000
 contains
  subroutine callme(proc)
    interface
      subroutine proc
      end
    end interface
    call proc
  end
end

module m2
  use m1
  private
  public modproctest
  integer :: n = 0
 contains
  subroutine modproc
    n = n + 1
  end
  subroutine modproctest
    do j = 1, iters
      call callme(modproc)
    end do
    print *, '  modproc', n
  end
end

module m3
  use m1
 contains
  subroutine innerproctest
    integer :: m = 0
    do j = 1, iters
      call callme(innerproc)
    end do
    print *, 'innerproc', m
   contains
    subroutine innerproc
      m = m + 1
    end
  end
end

program main
  use m1
  use m2
  use m3
  integer :: n = 0
  do j = 1, iters
    call callme(mainproc)
  end do
  print *, ' mainproc', n
  call modproctest
  call innerproctest
 contains
  subroutine mainproc
    n = n + 1
  end
end
```

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


More information about the llvm-commits mailing list