Starting from Clang 18, I get a masked_gather instead of regular load in vectorizer.
Reproducer:
Top of Trunk Clang:
https://godbolt.org/z/aj91K1eaf
See LoopVectorize debug prints:
LAA: Bad stride - Not an AddRecExpr pointer %arrayidx = getelementptr inbounds i32, ptr %a1, i64 %idxprom, !dbg !26 SCEV: ((4 * %idxprom) + %a1)
Clang 17:
https://godbolt.org/z/Y9W56Wds5
I believe that the issue is happening due to instcombine transforming SUB -> XOR. Does it load unscevable pattern?