[PATCH] D36922: [LibCallSimplifier] try harder to fold memcmp with constant arguments

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 20 07:47:34 PDT 2017


spatel added a comment.

In https://reviews.llvm.org/D36922#846700, @majnemer wrote:

> Canonicalizing away from memcmp seems pretty good to me. An easy way (I think) to show benefit is that multiple memcmps involving the same non-constant operand will CSE the loads which results in a considerably more analyzable result.


That's correct, and sorry if it wasn't clear, but let me link directly to https://bugs.llvm.org/show_bug.cgi?id=34032#c13 which has this manufactured example:
https://godbolt.org/g/QjVXvS

Does that provide the required motivation/benefit?


https://reviews.llvm.org/D36922





More information about the llvm-commits mailing list