[SCEV] applyLoopGuards drops information on SCEV builtin_assumes()
applyLoopGuards tries to rewrite a SCEV expression using assumes. The order of the assumes in the source code affects the rewritten SCEV and sometimes we lose information. An example is https://godbolt.org/z/vYnvKcrME where the vectorizer can't prove tripcount % VF = 0 despite of the assumption with that information. If the order of the assumes is changed as in https://godbolt.org/z/Wf445MMha code is optimized. This is since the assume (tripcount > 0) rewrites a new SCEV that loses the divisibility information. Need to think of a way to conserve the already rewritten expression of a certain value.
Interesting cases! Review to add IR tests available: https://reviews.llvm.org/D126460
Possible fix: https://reviews.llvm.org/D126502