[all-commits] [llvm/llvm-project] 5fb67e: [InstCombine] Fold memcmp of constant arrays and v...
Martin Sebor via All-commits
all-commits at lists.llvm.org
Fri Jun 17 09:37:23 PDT 2022
Author: Martin Sebor <msebor at redhat.com>
Date: 2022-06-17 (Fri, 17 Jun 2022)
[InstCombine] Fold memcmp of constant arrays and variable size
The memcmp simplifier is limited to folding to constants calls with constant
arrays and constant sizes. This change adds the ability to simplify
memcmp(A, B, N) calls with constant A and B and variable N to the pseudocode
N <= Pos ? 0 : (A < B ? -1 : B < A ? +1 : 0)
where Pos is the offset of the first mismatch between A and B.
Differential Revision: https://reviews.llvm.org/D127766
More information about the All-commits