Promotion is always legal when a store within the loop is guaranteed to execute.
However, this is not a necessary condition - for promotion to be memory model semantics-preserving, it is enough to have a store that dominates every exit block. This is because if the store dominates every exit block, the fact the exit block was executed implies the original store was executed as well.
Changing from the or and exit scheme to the and scheme should be NFC. Please separate and land without further review. (In particular, if this turns out *not* to be NFC, I want to be able to bisect to the refactoring.)