This came up during D38948:
CreateAddRecFromPHIWithCastsImpl() adds an IncrementNUSW overflow predicate which allows the PSCEV rewriter to rewrite this scev expression:
(zext i8 {0, + , (trunc i32 step to i8)} to i32)
into
{0, +, (sext i8 (trunc i32 step to i8) to i32)}
But then it adds the wrong Equal predicate:
%step == (zext i8 (trunc i32 %step to i8) to i32).
instead of:
%step == (sext i8 (trunc i32 %step to i8) to i32)
This is fixed here.
How about reducing the capture list of this lambda so that we don't have both Signed and isSigned in scope?
Alternately, you could s/isSigned/CreateSignExtend/ (actually now that I think of it, I like this option better than the first option).
Finally, the LLVM convention is to start variable names with uppercase.