Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/rules/llvmrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,20 @@ end
API.moveBefore(newo, err, B)
normal =
(unsafe_load(normalR) != C_NULL) ? LLVM.Instruction(unsafe_load(normalR)) : nothing
if shadowR != C_NULL && normal !== nothing
t_shadow = normal
if shadowR != C_NULL
t_shadow1 = if normal !== nothing
normal
else
LLVM.null(value_type(orig))
end
t_shadow = t_shadow1
width = get_width(gutils)
if width != 1
t_shadow = UndefValue(
LLVM.LLVMType(API.EnzymeGetShadowType(width, value_type(normal))),
LLVM.LLVMType(API.EnzymeGetShadowType(width, value_type(t_shadow1))),
)
for idx = 1:width
t_shadow = insert_value!(B, t_shadow, normal, idx - 1)
t_shadow = insert_value!(B, t_shadow, t_shadow1, idx - 1)
end
end
unsafe_store!(shadowR, t_shadow.ref)
Expand Down
Loading