https://github.com/nikic approved this pull request. LGTM. I don't see any obvious reason why profitability here should depend on whether the cast is unique or not. https://github.com/llvm/llvm-project/pull/92119