From f2a9361619ae27c744e32734f0eae89a72a69b4a Mon Sep 17 00:00:00 2001 From: William Moses Date: Sun, 18 Feb 2024 19:57:23 -0500 Subject: [PATCH] Handle new debug format conversion (#1737) --- enzyme/Enzyme/FunctionUtils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); } }