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

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 20 16:50:34 PDT 2017


majnemer added a comment.

In https://reviews.llvm.org/D36922#846834, @spatel wrote:

> 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?


In my eyes, yes.


https://reviews.llvm.org/D36922





More information about the llvm-commits mailing list