davemgreen wrote: I've tried to move this into aggressive instcombine to allow it to check for trees of loads first. The transform is looking up through trees already, so maybe that is a better place for it. Let me know what you think. https://github.com/llvm/llvm-project/pull/137875