Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Sep 15, 2024
1 parent 4799b39 commit fbc6232
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion enzyme/Enzyme/AdjointGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -3066,8 +3066,35 @@ class AdjointGenerator : public llvm::InstVisitor<AdjointGenerator> {
EmitNoTypeError(str, MS, gutils, BuilderZ);
return;
}
}
known:;
{
unsigned start = 0;
while (1) {
unsigned nextStart = size;

auto dt = vd[{-1}];
for (size_t i = start; i < size; ++i) {
bool Legal = true;
dt.checkedOrIn(vd[{(int)i}], /*PointerIntSame*/ true, Legal);
if (!Legal) {
nextStart = i;
break;
}
}
if (!dt.isKnown()) {
TR.dump();
llvm::errs() << " vd:" << vd.str() << " start:" << start
<< " size: " << size << " dt:" << dt.str() << "\n";
}
assert(dt.isKnown());
toIterate.emplace_back(dt.isFloat(), start, nextStart - start);

if (nextStart == size)
break;
start = nextStart;
}
}
}

#if 0
unsigned dstalign = dstAlign.valueOrOne().value();
Expand Down

0 comments on commit fbc6232

Please sign in to comment.