https://github.com/vzakhari approved this pull request. It looks reasonable to me, though I think all these transformation should be guarded by an FMF flag (e.g. `afn`). I am not asking to do it in this PR. https://github.com/llvm/llvm-project/pull/166802