[InstCombine] Fold strncmp of constant arrays and variable size
Extend the solution accepted in D127766 to strncmp and simplify strncmp(A, B, N) calls with constant A and B and variable N to the equivalent of N <= Pos ? 0 : (A < B ? -1 : B < A ? +1 : 0) where Pos is the offset of either the first mismatch between A and B or the terminating null character if both A and B are equal strings. Reviewed By: courbet Differential Revision: https://reviews.llvm.org/D128089
parent
e263a767
Please register or sign in to comment