[PATCH] D131260: [DAG] select Cond, -1, C --> or (sext Cond), C if Cond is MVT::i1

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 7 18:26:47 PDT 2022


deadalnix added inline comments.


================
Comment at: llvm/test/CodeGen/X86/memcmp.ll:371
 ; X64-NEXT:    xorl %eax, %eax
 ; X64-NEXT:    cmpl %edx, %ecx
+; X64-NEXT:    sbbl %eax, %eax
----------------
In both cases here, `cmpl %edx, %ecx` seems to be recomputed for no reason (?) It seems to be able to reuse `cmpl %ecx, %eax` in length5 and `cmpw %dx, %cx` in length3, at least before this diff.

Is there a reason why this isn't the case here? I'm not quite sure how memcmp is being lowered, and `-debug` really isn't useful here. @gchatelet , you were looking for ways to improve memcmp, I think there is a low hanging fruit somewhere in there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131260



More information about the llvm-commits mailing list