diff --git a/enzyme/Enzyme/FunctionUtils.cpp b/enzyme/Enzyme/FunctionUtils.cpp index 160ccc740f8a..fdba018bd600 100644 --- a/enzyme/Enzyme/FunctionUtils.cpp +++ b/enzyme/Enzyme/FunctionUtils.cpp @@ -754,6 +754,16 @@ void PreProcessCache::AlwaysInline(Function *NewF) { for (auto CI : ToInline) { InlineFunctionInfo IFI; +#if LLVM_VERSION_MAJOR >= 18 + auto F = CI->getCalledFunction(); + if (CI->getParent()->IsNewDbgInfoFormat != F->IsNewDbgInfoFormat) { + if (CI->getParent()->IsNewDbgInfoFormat) { + F->convertToNewDbgValues(); + } else { + F->convertFromNewDbgValues(); + } + } +#endif InlineFunction(*CI, IFI); } }