Skip to content

Commit 3c17390

Browse files
authored
Svec no shadow (#2757)
1 parent 55176bc commit 3c17390

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rules/llvmrules.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ end
255255
API.moveBefore(newo, err, B)
256256
normal =
257257
(unsafe_load(normalR) != C_NULL) ? LLVM.Instruction(unsafe_load(normalR)) : nothing
258-
if shadowR != C_NULL
258+
if unsafe_load(shadowR) != C_NULL
259259
t_shadow1 = if normal !== nothing
260260
normal
261261
else

src/rules/typeunstablerules.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,7 +2018,7 @@ function error_if_differentiable(::Type{T}) where {T}
20182018
end
20192019

20202020
function common_f_svec_ref_fwd(offset, B, orig, gutils, normalR, shadowR)
2021-
if is_constant_value(gutils, orig) && is_constant_inst(gutils, orig)
2021+
if is_constant_value(gutils, orig) || unsafe_load(shadowR) == C_NULL
20222022
return true
20232023
end
20242024

@@ -2097,7 +2097,7 @@ function common_f_svec_ref_fwd(offset, B, orig, gutils, normalR, shadowR)
20972097
end
20982098

20992099
function common_f_svec_ref_augfwd(offset, B, orig, gutils, normalR, shadowR, tapeR)
2100-
if is_constant_value(gutils, orig)
2100+
if is_constant_value(gutils, orig) || unsafe_load(shadowR) == C_NULL
21012101
return true
21022102
end
21032103

0 commit comments

Comments
 (0)