Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
4 changed files
with
507 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.