Skip to content

Commit

Permalink
Also memset undef as sret
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Sep 18, 2023
1 parent eb841ac commit 1ef5a56
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion enzyme/Enzyme/AdjointGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2754,7 +2754,12 @@ class AdjointGenerator
if (CI->isZero()) {
auto root = getBaseObject(MS.getOperand(0));
bool writtenTo = false;
if (isa<AllocaInst>(root) || isAllocationCall(root, gutils->TLI)) {
bool undefMemory =
isa<AllocaInst>(root) || isAllocationCall(root, gutils->TLI);
if (auto arg = dyn_cast<Argument>(root))
if (arg->hasStructRetAttr())
undefMemory = true;
if (undefMemory) {
Instruction *cur = MS.getPrevNode();
while (cur) {
if (cur == root)
Expand Down

0 comments on commit 1ef5a56

Please sign in to comment.