From 14540efd84e8968153d0ca3ea30e23ae22dd3126 Mon Sep 17 00:00:00 2001 From: William Moses Date: Tue, 15 Aug 2023 03:09:13 +0900 Subject: [PATCH] Adapt to abi bump (#995) --- src/api.jl | 2 +- src/compiler.jl | 2 +- src/gradientutils.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.jl b/src/api.jl index 7ab25dd726..8f7a030406 100644 --- a/src/api.jl +++ b/src/api.jl @@ -210,7 +210,7 @@ EnzymeGetShadowType(width, T) = ccall((:EnzymeGetShadowType, libEnzyme), LLVMTyp EnzymeGradientUtilsReplaceAWithB(gutils, a, b) = ccall((:EnzymeGradientUtilsReplaceAWithB, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef, LLVMValueRef), gutils, a, b) EnzymeGradientUtilsErase(gutils, a) = ccall((:EnzymeGradientUtilsErase, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef), gutils, a) -EnzymeGradientUtilsEraseWithPlaceholder(gutils, a, erase) = ccall((:EnzymeGradientUtilsEraseWithPlaceholder, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef, UInt8), gutils, a, erase) +EnzymeGradientUtilsEraseWithPlaceholder(gutils, a, orig, erase) = ccall((:EnzymeGradientUtilsEraseWithPlaceholder, libEnzyme), Cvoid, (EnzymeGradientUtilsRef,LLVMValueRef, LLVMValueRef, UInt8), gutils, a, orig, erase) EnzymeGradientUtilsGetMode(gutils) = ccall((:EnzymeGradientUtilsGetMode, libEnzyme), CDerivativeMode, (EnzymeGradientUtilsRef,), gutils) EnzymeGradientUtilsGetWidth(gutils) = ccall((:EnzymeGradientUtilsGetWidth, libEnzyme), UInt64, (EnzymeGradientUtilsRef,), gutils) EnzymeGradientUtilsNewFromOriginal(gutils, val) = ccall((:EnzymeGradientUtilsNewFromOriginal, libEnzyme), LLVMValueRef, (EnzymeGradientUtilsRef, LLVMValueRef), gutils, val) diff --git a/src/compiler.jl b/src/compiler.jl index 9a8215b49d..7f534f12c8 100644 --- a/src/compiler.jl +++ b/src/compiler.jl @@ -4689,7 +4689,7 @@ function enzyme_custom_common_rev(forward::Bool, B, orig::LLVM.CallInst, gutils, unsafe_store!(normalR, normalV) else ni = new_from_original(gutils, orig) - erase_with_placeholder(gutils, ni) + erase_with_placeholder(gutils, ni, orig) end end diff --git a/src/gradientutils.jl b/src/gradientutils.jl index 6ecaac4bef..0f41841426 100644 --- a/src/gradientutils.jl +++ b/src/gradientutils.jl @@ -20,7 +20,7 @@ function get_uncacheable(gutils::GradientUtils, orig::LLVM.CallInst) return uncacheable end -erase_with_placeholder(gutils::GradientUtils, inst::LLVM.Instruction, erase::Bool=true) = API.EnzymeGradientUtilsEraseWithPlaceholder(gutils, inst, erase) +erase_with_placeholder(gutils::GradientUtils, inst::LLVM.Instruction, orig::LLVM.Instruction, erase::Bool=true) = API.EnzymeGradientUtilsEraseWithPlaceholder(gutils, inst, orig, erase) is_constant_value(gutils::GradientUtils, val::LLVM.Value) = API.EnzymeGradientUtilsIsConstantValue(gutils, val) != 0 is_constant_inst(gutils::GradientUtils, inst::LLVM.Instruction) = API.EnzymeGradientUtilsIsConstantInstruction(gutils, inst) != 0