c-rhodes wrote: I'm not actually sure the visited set is necessary anymore now types can't be recursive (#114799), it looks like it can be removed, might be better to do that as a follow up https://github.com/llvm/llvm-project/pull/221743