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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 14:21:32 PDT 2018


xbolva00 added a comment.

In https://reviews.llvm.org/D50019#1183062, @efriedma wrote:

> Not sure how often that shows up, but yes, if you can prove the the pointer is dereferenceable, it's okay to transform to memcmp.


It is not so rare, I see it in many code bases.

Motivating example;
https://searchcode.com/file/71153892/src/resmom/linux/mom_mach.c


https://reviews.llvm.org/D50019





More information about the llvm-commits mailing list