Skip to content

Commit

Permalink
Don't store undef value sret
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Oct 22, 2024
1 parent 1a22934 commit 9da1d3e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions enzyme/Enzyme/CApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1966,6 +1966,12 @@ void EnzymeFixupJuliaCallingConvention(LLVMValueRef F_C) {
outinds.push_back(ConstantInt::get(B.getInt32Ty(), v));
}

if (isa<UndefValue>(in) || isa<PoisonValue>(in))
return;

if (isa<UndefValue>(out) || isa<PoisonValue>(out))
return;

if (outinds.size() > 1)
out = B.CreateInBoundsGEP(sretTy, out, outinds);
if (ininds.size() > 1)
Expand Down

0 comments on commit 9da1d3e

Please sign in to comment.