Critical edge splitting called by GVN and Loop Rotation leads to losing of llvm.loop.vectorize.enable metadata for loops as critical edge splitting replaces a branch, corresponding to the loop latch, with a new one.
My patch clones loop latch metadata to a new latch branch thus fixing the issue.
I also had to add LoopInfo analysis for GVN, as it's needed for latch metadata cloning.