Revision 7bba1757c575525403403994ac6408714067c5af authored by Yichao Yu on 07 November 2017, 04:38:14 UTC, committed by Yichao Yu on 13 December 2017, 19:13:16 UTC
LLVM has really bad support for returns_twice functions and can incorrectly move memory operations
(both at IR and machine code level) due to missing control flow edge.
By outlining the exception body, we can hide these functions from LLVM completely
(they only exist in C code) and prevent all miscompilation.
This also makes it much easier to check the correctness of heap to stack allocation optimization
especially since not all memory operation intrinsics in LLVM has a volatile counterpart.

This will obviously inhibit some valid optimizations too.
These are mainly forwarding of memory operations from the caller to the exception body
(since the other way around is almost always invalid) and can be improved with some simple IPO.

This also makes it unnecessary to mark any memory operations on the stack with `volatile`
this should also improve optimization in certain cases.

Since we are scanning all the instructions in the outlined code anyway this also includes
a simple optimization to delete exception frame that can't trigger.

This implements a tweaked version of https://discourse.julialang.org/t/avoid-llvm-setjmp-bug/1140

Fix #17288
1 parent 87c1d4f
Raw File
appveyor.yml
environment:
#  USEMSVC: "1"
  matrix:
  - ARCH: "i686"
    JULIA_TEST_MAXRSS_MB: 500
  - ARCH: "x86_64"
    JULIA_TEST_MAXRSS_MB: 450

# Only build on master and PR's for now, not personal branches
# Whether or not PR's get built is determined in the webhook settings
branches:
  only:
    - master
    - /^release-.*/

skip_commits:
# Add [av skip] to commit messages for docfixes, etc to reduce load on queue
  message: /\[av skip\]/

notifications:
  - provider: Email
    on_build_success: false
    on_build_failure: false
    on_build_status_changed: false

clone_depth: 50

init:
# Carriage returns are bad
  - git config --global core.autocrlf input

cache:
# Cache large downloads to avoid network unreliability
  - C:\cygdownloads
  - llvm-3.9.1-i686-w64-mingw32-juliadeps-r07.7z
  - llvm-3.9.1-x86_64-w64-mingw32-juliadeps-r07.7z
  - usr/bin/busybox.exe

build_script:
# If there's a newer build queued for the same PR, cancel this one
  - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
        https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
        Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
        throw "There are newer queued builds for this pull request, failing early." }
# Remove C:\MinGW\bin from the path, the version of MinGW installed on
# AppVeyor is not compatible with the cross-compiled Julia Windows binaries
  - set PATH=%PATH:C:\MinGW\bin;=%
# Remove git's msys2 from path, since it conflicts with cygwin1.dll
  - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  - ps: contrib/windows/install-cygwin.ps1
#  - '"%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64'
  - C:\cygwin-%ARCH%\bin\sh.exe --login /cygdrive/c/projects/julia/contrib/windows/appveyor_build.sh

test_script:
  - usr\bin\julia -e "versioninfo()"
  - usr\bin\julia --sysimage-native-code=no -e "true"
  - cd julia-* && .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl all &&
      .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl libgit2-online download pkg
  - cd ..
  - usr\bin\julia usr\share\doc\julia\examples\embedding\embedding-test.jl examples\embedding\embedding.exe
back to top