1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Go to file
Simon Pilgrim 8a515df296 [x86, CGP] increase memcmp() expansion up to 4 load pairs
It should be a win to avoid going out to the system lib for all small memcmp() calls using scalar ops. For x86 32-bit, this means most everything up to 16 bytes. For 64-bit, that doubles because we can do 8-byte loads.

Notes:

    Reduced from 4 to 2 loads for -Os behavior, which might not be optimal in all cases. It's effectively a question of how much do we trust the system implementation. Linux and macOS (and Windows I assume, but did not test) have optimized memcmp() code for x86, so it's probably not bad either way? PPC is using 8/4 for defaults on these. We do not expand at all for -Oz.

    There are still potential improvements to make for the CGP expansion IR and/or lowering such as avoiding select-of-constants (D34904) and not doing zexts to the max load type before doing a compare.

    We have special-case SSE/AVX codegen for (memcmp(x, y, 16/32) == 0) that will no longer be produced after this patch. I've shown the experimental justification for that change in PR33329:

https://bugs.llvm.org/show_bug.cgi?id=33329#c12
TLDR: While the vector code is a likely winner, we can't guarantee that it's a winner in all cases on all CPUs, so I'm willing to sacrifice it for the greater good of expanding all small memcmp(). If we want to resurrect that codegen, it can be done by adjusting the CGP params or poking a hole to let those fall-through the CGP expansion.

Committed on behalf of Sanjay Patel

Differential Revision: https://reviews.llvm.org/D35067

llvm-svn: 308322
2017-07-18 15:55:30 +00:00
bindings [NFC] Remove multiple semicolons 2017-06-28 23:15:16 +00:00
cmake [Solaris] Detect Solaris LD, use detection results to pass Solaris-ld options 2017-07-12 21:43:14 +00:00
docs [docs] AliasAnalysis: clarify that PartialAlias doesn't enforce 2017-07-15 09:09:24 +00:00
examples fix typos in comments and error messges; NFC 2017-07-13 06:48:39 +00:00
include Make EHFrames available to sub-classes of RTDyldMemoryManager. 2017-07-18 15:50:28 +00:00
lib [x86, CGP] increase memcmp() expansion up to 4 load pairs 2017-07-18 15:55:30 +00:00
projects Add temporary workaround to allow in-tree libc++ builds on Windows 2017-05-11 01:44:30 +00:00
resources
runtimes [CMake]Use LLVM_LIBRARY_DIR for lib path. 2017-07-14 00:35:21 +00:00
test [x86, CGP] increase memcmp() expansion up to 4 load pairs 2017-07-18 15:55:30 +00:00
tools Revert "Adding temporary debugging info to llvm-mt to solve fedora failure." 2017-07-18 03:38:04 +00:00
unittests [codeview] Remove TypeServerHandler and PDBTypeServerHandler 2017-07-17 20:28:06 +00:00
utils [AArch64] Extend CallingConv::X86_64_Win64 to AArch64 as well 2017-07-17 20:05:19 +00:00
.arcconfig project_id is from another era in phabricator land and does not provide any value. 2016-09-27 15:47:29 +00:00
.clang-format
.clang-tidy
.gitignore gitignore: Ignore .vs folder (VS2017 config files) 2017-04-08 00:16:58 +00:00
CMakeLists.txt CMake: Add LLVM_UTILS_INSTALL_DIR option 2017-07-05 12:57:30 +00:00
CODE_OWNERS.TXT Remove the BBVectorize pass. 2017-06-30 07:09:08 +00:00
configure
CREDITS.TXT Another test commit 2017-07-01 03:24:06 +00:00
LICENSE.TXT Bump year to 2017 in LICENSE.txt 2017-01-12 18:02:42 +00:00
llvm.spec.in
LLVMBuild.txt
README.txt Test commit. Added a blank line. 2017-03-06 20:45:33 +00:00
RELEASE_TESTERS.TXT [RelTest] Diana is doing both releases now 2017-07-14 08:33:52 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.