https://github.com/arsenm requested changes to this pull request. This should have already happened in the middle end optimizer. This would also need a phase ordering test https://github.com/llvm/llvm-project/pull/172069