Skip to content

Commit

Permalink
Fix analysis insertion of anything
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Sep 18, 2023
1 parent fd06730 commit 50de4a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion enzyme/Enzyme/TypeAnalysis/TypeTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,12 @@ class TypeTree : public std::enable_shared_from_this<TypeTree> {
return false;

// Inserting say a [0]:anything into a [-1]:Float
if (CT == BaseType::Anything)
if (CT == BaseType::Anything) {
// If both at same index, remove old index
if (newMoreGeneralThanOld)
toremove.insert(pair.first);
continue;
}

// Otherwise, inserting a non-equivalent pair into a more general
// slot. This is invalid.
Expand Down

0 comments on commit 50de4a2

Please sign in to comment.