This is a patch to fix the bug in alignment calculation (see https://reviews.llvm.org/D90529#2619492).
Consider this code:
call void @llvm.assume(i1 true) ["align"(i32* %a, i32 32, i32 28)] %arrayidx = getelementptr inbounds i32, i32* %a, i64 -1 ; aligment of %arrayidx?
The llvm.assume guarantees that %a - 28 is 32-bytes aligned, meaning that %a is 32k + 28 for some k.
Therefore a - 4 cannot be 32-bytes aligned but the existing code was calculating the pointer as 32-bytes aligned.
The reason why this happened is as follows.
DiffSCEV stores %arrayidx - %a which is -4.
OffSCEV stores the offset value of “align”, which is 28.
DiffSCEV + OffSCEV = 24 should be used for a - 4's offset from 32k, but DiffSCEV - OffSCEV = 32 was being used instead.