]> granicus.if.org Git - llvm/commit
Merging r367898:
authorHans Wennborg <hans@hanshq.net>
Tue, 6 Aug 2019 11:04:11 +0000 (11:04 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 6 Aug 2019 11:04:11 +0000 (11:04 +0000)
commitd8761ed64995af6bb0a3fe07354ef4950c428689
treeb3dae86519c15bd2be9f5663bcf270b511bf8634
parent68d487984c48feb9d90a7d1c80b4f695e3c157e4
Merging r367898:
------------------------------------------------------------------------
r367898 | evandro | 2019-08-05 20:09:14 +0200 (Mon, 05 Aug 2019) | 22 lines

[AArch64] Expand bcmp() for small block lengths

Patch D56593 by @courbet results in calls to `bcmp()` in some cases, should
the target support the it.  Unless `TTI::MemCmpExpansionOptions()`
is overridden by the target.

In a proprietary benchmark we see a performance drop of about 12% on PNG
compression before this patch, though it passes all tests.

This patch mirrors X86 for AArch64 and initializes
`TTI::MemCmpExpansionOptions()` to then expand calls to `bcmp()` when
appropriate.  No tuning of the parameters was performed, but, at this point,
it's enough to recover the performance drop above.

This problem also exists on ARM.  Once a consensus is reached for AArch64, we
can work to fix ARM as well.

Authors:
- Evandro Menezes (@evandro) <e.menezes@samsung.com>
- Brian Rzycki (@brzycki) <b.rzycki@samsung.com>

Differential revision: https://reviews.llvm.org/D64805
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368017 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64TargetTransformInfo.cpp
lib/Target/AArch64/AArch64TargetTransformInfo.h
test/CodeGen/AArch64/bcmp-inline-small.ll [new file with mode: 0644]