[PATCH] D136244: [AArch64] Optimize memcmp when the result is tested for [in]equality with 0
Allen zhong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 05:56:23 PDT 2022
Allen added inline comments.
================
Comment at: llvm/test/CodeGen/AArch64/i128-cmp.ll:11
+; CHECK-NEXT: ccmp x1, x3, #0, eq
+; CHECK-NEXT: cset w0, ne
; CHECK-NEXT: ret
----------------
dmgreen wrote:
> Allen wrote:
> > dmgreen wrote:
> > > Are you sure this is correct? It doesn't look right.
> > >
> > > I think I would expect `ccmp #0, eq; cset eq`.
> > Yes, I test the executive for the initial case in https://github.com/llvm/llvm-project/issues/58061
> How did you test that? Is it the code from https://gcc.godbolt.org/z/Tv1YP6bPc? Could it have been constant-folded away?
Yes, I test the executive very simple, just run the following cmd with and without the changes.
**~/llvm-project-upstream/build/bin/clang -march=armv8.2-a -O3 run.c -ffast-math;./a.out **
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136244/new/
https://reviews.llvm.org/D136244
More information about the llvm-commits
mailing list