From f4dc70ceff49bb7452e3cd73b18d950de234afd0 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sun, 20 Aug 2023 23:41:39 +0200 Subject: [PATCH] Fix `UndefVarError: ST not defined` --- src/compiler.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler.jl b/src/compiler.jl index ee5f327d6f..7a163a2bc5 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -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) @@ -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)