pmatos wrote: @aheejin have you tried removing the mem2reg pass and see if things still work? AFAIR, it was mem2reg which held this together and it was forcefully enabled at all optimization levels. https://github.com/llvm/llvm-project/pull/81965