From 9da1d3e2a6c89f1b2acf0db410f9368aa56a35aa Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Tue, 22 Oct 2024 17:12:03 -0400 Subject: [PATCH] Don't store undef value sret --- enzyme/Enzyme/CApi.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/enzyme/Enzyme/CApi.cpp b/enzyme/Enzyme/CApi.cpp index 4e583273698..14215fb6dd2 100644 --- a/enzyme/Enzyme/CApi.cpp +++ b/enzyme/Enzyme/CApi.cpp @@ -1966,6 +1966,12 @@ void EnzymeFixupJuliaCallingConvention(LLVMValueRef F_C) { outinds.push_back(ConstantInt::get(B.getInt32Ty(), v)); } + if (isa(in) || isa(in)) + return; + + if (isa(out) || isa(out)) + return; + if (outinds.size() > 1) out = B.CreateInBoundsGEP(sretTy, out, outinds); if (ininds.size() > 1)