Skip to content

Commit

Permalink
Change lowering of gc preserve (JuliaLang#34379)
Browse files Browse the repository at this point in the history
This fixes JuliaLang#34247 by changing the way gc preserve is lowered.
Instead of lowering it in a macro, lower it in the frontend.
This allows us to use an SSA value directly for the return token
of the gc begin expression. This bypasses the slot-renaming pass
of the compiler, thus preventing the compiler from trying to save
and restore the token. Of course, this kind of code would generally
not be legal (because it uses an SSA value outside of the regular
domination relation), but since this is a julia restriction, not
an LLVM restriction, we can simply exempt gc_begin tokens from this
particular validation. This works fine at the LLVM level also, because
it doesn't have this particular restriction. It also doesn't have
the same correctness problems as doing the same for non-token values,
as the tokens get lowered away by the try/catch lowering before reaching
the LLVM backend.

(cherry picked from commit 07a16d6)
  • Loading branch information
Keno authored and BioTurboNick committed Apr 13, 2020
1 parent 4b0d9bc commit d2a69f8
Showing 1 changed file with 4,429 additions and 4,429 deletions.
Loading

0 comments on commit d2a69f8

Please sign in to comment.