Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions enzyme/Enzyme/ActivityAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ bool isInactiveCall(CallBase &CI) {
// clang-format off
const char *KnownInactiveFunctionsStartingWith[] = {
"f90io",
"_FortranAio", // LLVM flang's I/O runtime (modern equivalent of f90io)
"$ss5print",
"strcpy",
"_ZTv0_n24_NSoD", //"1Ev, 0Ev
Expand All @@ -240,6 +241,8 @@ const char *KnownInactiveFunctionsContains[] = {
"__enzyme_pointer", "__enzyme_ignore_derivatives"};

const StringSet<> KnownInactiveFunctions = {
"_FortranAClassIs", // Fortran runtime queries
"_FortranATrim", // Fortran character handling
"mpfr_greater_p",
"__nv_isnand",
"__nv_isnanf",
Expand Down
12 changes: 9 additions & 3 deletions enzyme/Enzyme/AdjointGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -3628,9 +3628,15 @@ class AdjointGenerator : public llvm::InstVisitor<AdjointGenerator> {
minInt = pair.first[0];
mv = pair.second;
}
assert(mv != BaseType::Unknown);
vd.insert({0}, mv);
goto known;
// Note the comparison above is unsigned, so an entry at the
// any-offset index -1 is skipped and mv is left unknown. That
// is the common shape for a tree such as {[]:Pointer,
// [-1]:Anything}, so fall through to the diagnostics below
// rather than assuming a type was found.
if (mv != BaseType::Unknown) {
vd.insert({0}, mv);
goto known;
}
}
}
}
Expand Down
Loading