The direct motivation here is to undo an unprofitable vectorization performed by SLP, but the transform seems generally useful as well. If we are storing a zero to memory, we can use a single scalar store (from X0) for all power of two sizes up to XLen.
Note: We can extend this transform in a bunch of ways. I'm deliberately starting narrow to focus on the two questions highlighted just above.
Did you intend to leave FLAGIT in here?