We don't actually check whether a MemoryAccess is affine in very many places, but one important one is in checks for aliasing.
While I agree with the commit message, I am not aware of any real benefit this will provide us given that we only leverage the constant range ScalarEvolution range analysis. If we would use a better one, e.g., along the lines of https://reviews.llvm.org/D20230, I think this patch does make sense.
This opinion was basically written down in the code:
// Check if we have non-affine accesses left, if so bail out as we cannot // generate a good access range yet.
We ran into a case similar to the included testcase, where we need to generate a runtime alias check with a memset in order to vectorize a loop. (memset isn't really non-affine, but we currently model it that way.)