https://github.com/benlangmuir commented: This change looks good to me, but can we add a test case? It seems like it ought to be possible to catch this in a lit test, even if it would only reproduce rarely. https://github.com/llvm/llvm-project/pull/151774