[PATCH] D50019: [InstCombine] Expand strcmp(s, "x") to memcmp

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 15:41:46 PDT 2018


efriedma added a comment.

Oh, okay, that makes more sense.

Unfortunately, this transform is still illegal: if the unknown operand is the empty string, memcmp can read past the end of the string, which is undefined behavior (and may crash in practice).


https://reviews.llvm.org/D50019





More information about the llvm-commits mailing list