Issue 1:
MWE:

@inline use(i::Int64) =
Base.llvmcall("""%slot = alloca i64
store volatile i64 %0, i64* %slot
%value = load volatile i64, i64* %slot
ret i64 %value""", Int64, Tuple{Int64}, i)

struct Wrapper{F} <: Core.Function
f::F
end

function (k::Wrapper)(arg1, arg2)
(k.f)(arg1, arg2)
return nothing
end

foobar(unused, used) = use(used)

code_llvm(Wrapper(foobar), Tuple{Type{Int64}, Int64})

Before #27857:

; Function Wrapper
; Location: /home/tbesard/Julia/CUDAnative/wip.jl:13
define void @julia_Wrapper_32376(%jl_value_t addrspace(10)*, i64) {
top:
%slot.i = alloca i64, align 8
; Function foobar; {
; Location: /home/tbesard/Julia/CUDAnative/wip.jl:18
; Function use; {
; Location: /home/tbesard/Julia/CUDAnative/wip.jl:1
%slot.i.0.slot.i.0..sroa_cast = bitcast i64* %slot.i to i8*
call void @llvm.lifetime.start.p0i8(i64 8, i8* %slot.i.0.slot.i.0..sroa_cast)
store volatile i64 %1, i64* %slot.i, align 8
%slot.i.0.slot.i.0.slot.0.slot.0.value.i = load volatile i64, i64* %slot.i, align 8
call void @llvm.lifetime.end.p0i8(i64 8, i8* %slot.i.0.slot.i.0..sroa_cast)
;}}
; Location: /home/tbesard/Julia/CUDAnative/wip.jl:14
ret void
}

After:

; Function Wrapper
; Location: /home/tbesard/Julia/CUDAnative/wip.jl:13
define void @julia_Wrapper_32797(%jl_value_t addrspace(10)*, i64) {
top:
%2 = alloca %jl_value_t addrspace(10)*, i32 3
%gcframe = alloca %jl_value_t addrspace(10)*, i32 3
%3 = bitcast %jl_value_t addrspace(10)** %gcframe to i8*
call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 24, i32 0, i1 false)
%thread_ptr = call i8* asm "movq %fs:0, $0", "=r"()
%ptls_i8 = getelementptr i8, i8* %thread_ptr, i64 -10920
%ptls = bitcast i8* %ptls_i8 to %jl_value_t***
%4 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 0
%5 = bitcast %jl_value_t addrspace(10)** %4 to i64*
store i64 2, i64* %5
%6 = getelementptr %jl_value_t**, %jl_value_t*** %ptls, i32 0
%7 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 1
%8 = bitcast %jl_value_t addrspace(10)** %7 to %jl_value_t***
%9 = load %jl_value_t**, %jl_value_t*** %6
store %jl_value_t** %9, %jl_value_t*** %8
%10 = bitcast %jl_value_t*** %6 to %jl_value_t addrspace(10)***
store %jl_value_t addrspace(10)** %gcframe, %jl_value_t addrspace(10)*** %10
%11 = call %jl_value_t addrspace(10)* @jl_box_int64(i64 signext %1)
%12 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 2
store %jl_value_t addrspace(10)* %11, %jl_value_t addrspace(10)** %12
%13 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %2, i32 0
store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140506765508720 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %13
%14 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %2, i32 1
store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140506765445104 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %14
%15 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %2, i32 2
store %jl_value_t addrspace(10)* %11, %jl_value_t addrspace(10)** %15
%16 = call nonnull %jl_value_t addrspace(10)* @jl_invoke(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140506779001488 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %2, i32 3)
; Location: /home/tbesard/Julia/CUDAnative/wip.jl:14
%17 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 1
%18 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %17
%19 = getelementptr %jl_value_t**, %jl_value_t*** %ptls, i32 0
%20 = bitcast %jl_value_t*** %19 to %jl_value_t addrspace(10)**
store %jl_value_t addrspace(10)* %18, %jl_value_t addrspace(10)** %20
ret void
}

Bisected to 9277d3a.

Issue 2:
Somehow all atomics became really slow and allocating. Example:

julia> using Base.Threads
julia> using BenchmarkTools
julia> a = Atomic{Int64}(0);

julia> @btime atomic_add!($a,$1);
9.177 ns (0 allocations: 0 bytes)
julia> versioninfo()
Julia Version 0.6.3

julia> @btime atomic_add!($a,$1);
129.263 ns (1 allocation: 16 bytes)
julia> versioninfo()
Julia Version 0.7.0-alpha.136

This is very visible when inspecting @code_llvm: Instead of the hand-written llvmcall, we get some weird giant blob of compiler output.