[PATCH] D136244: [AArch64] Optimize memcmp when the result is tested for [in]equality with 0
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 11:33:10 PDT 2022
dmgreen 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
----------------
Allen wrote:
> 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 **
Have you tried with -fno-inline? The example godbolt link has everything inlined into main, and constant folded into the arguments of the printf's. It doesn't look like it is really testing the codegen.
I would expect the code to be the same as this for eq, due to the way i128 is split into i64 registers: https://godbolt.org/z/aed4bYn6n
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136244/new/
https://reviews.llvm.org/D136244
More information about the llvm-commits
mailing list