https://github.com/tblah commented: Thanks for your work on this. I will take a look at promotion/demotion when I get time, although I don't know much about affine so that will need review from somebody else anyway. https://github.com/llvm/llvm-project/pull/191854