[PATCH] D75519: [ExpandMemCmp] Properly constant-fold all compares.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 00:06:57 PST 2020


courbet marked an inline comment as done.
courbet added a comment.

In D75519#1903306 <https://reviews.llvm.org/D75519#1903306>, @efriedma wrote:

> Given memcmp expansion is running late in the pipeline, do you think we're possibly missing other relevant optimizations on the loads?  LICM, maybe?


It's definitely missing other optimizations. I tried moving it sooner in the pipeline some time ago for this reason (https://reviews.llvm.org/D60318), but it turned out to be much harder than I anticipated because of interactions with the sanitizers.



================
Comment at: llvm/test/CodeGen/X86/memcmp.ll:425
 ; X64-NEXT:    bswapl %ecx
+; X64-NEXT:    movl (%rsi), %edx
 ; X64-NEXT:    bswapl %edx
----------------
efriedma wrote:
> The scheduling here seems to be worse?
I think we could argue either way: the new scheduling interleaves loads and other computations, evening out the port pressure and increased compute parallelism. On the other hand it's true that there is less data parallelism. It should not matter with recent out-of-order cores anyway.
If you feel strongly about this I can go back to interleaving the data, this is actually orthogonal to the real change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75519/new/

https://reviews.llvm.org/D75519





More information about the llvm-commits mailing list