https://github.com/ssahasra approved this pull request. LGTM, except for the nit about `eraseFromParent()`. It will be good to keep the erase if that is legal. Also please wait a day for @arsenm to comment. https://github.com/llvm/llvm-project/pull/165265