Skip to content

Commit

Permalink
Fix UndefVarError: ST not defined (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored and michel2323 committed Nov 7, 2023
1 parent d41c7f5 commit c594ca4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2613,9 +2613,11 @@ function common_apply_iterate_fwd(offset, B, orig, gutils, normalR, shadowR)
emit_error(B, orig, "Enzyme: Not yet implemented, forward for jl_f__apply_iterate")
if shadowR != C_NULL
cal = new_from_original(gutils, orig)
width = get_width(gutils)
if width == 1
shadow = cal
else
ST = LLVM.LLVMType(API.EnzymeGetShadowType(width, value_type(orig)))
shadow = LLVM.UndefValue(ST)
for i in 1:width
shadow = insert_value!(B, shadow, cal, i-1)
Expand All @@ -2634,9 +2636,11 @@ function common_apply_iterate_augfwd(offset, B, orig, gutils, normalR, shadowR,

if shadowR != C_NULL
cal = new_from_original(gutils, orig)
width = get_width(gutils)
if width == 1
shadow = cal
else
ST = LLVM.LLVMType(API.EnzymeGetShadowType(width, value_type(orig)))
shadow = LLVM.UndefValue(ST)
for i in 1:width
shadow = insert_value!(B, shadow, cal, i-1)
Expand Down

0 comments on commit c594ca4

Please sign in to comment.