jmorse wrote: (added inline comment rather than deal with github further); an obvious fix is to perform this check before the call to eraseFromParent. I'll hold off on this as I've got too much in-flight right now. https://github.com/llvm/llvm-project/pull/74455