jayfoad wrote: SILoadStoreOptimizer is surely not the right place to implement something like this. It should be done as an IR optimization, or at instruction selection time. How do other targets handle this? https://github.com/llvm/llvm-project/pull/219019