llvm-project/llvm/test
Simon Pilgrim 483927aefb [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
..
Analysis [SystemZ] Add support for IBM z14 processor (2/3) 2017-07-17 17:42:48 +00:00
Assembler Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
Bindings [LLVM-C] [OCaml] Expose Type::subtypes. 2017-06-05 11:49:52 +00:00
Bitcode [AArch64] Extend CallingConv::X86_64_Win64 to AArch64 as well 2017-07-17 20:05:19 +00:00
BugPoint bugpoint: disabling symbolication of bugpoint-executed programs 2017-06-09 07:29:03 +00:00
CodeGen [x86, CGP] increase memcmp() expansion up to 4 load pairs 2017-07-18 15:55:30 +00:00
DebugInfo Fix pdbdump-headers.test after TPI hash changes 2017-07-18 00:44:10 +00:00
Examples
ExecutionEngine [RuntimeDyld, PowerPC] Fix check for external symbols when detecting reloction overflow 2017-05-23 14:51:18 +00:00
Feature Remove the BBVectorize pass. 2017-06-30 07:09:08 +00:00
FileCheck [llvm] Remove redundant check-prefix=CHECK from tests. NFC. 2017-07-17 17:32:45 +00:00
Instrumentation [sancov] Fix PR33732 2017-07-18 11:47:56 +00:00
Integer
JitListener
LTO [LTO] Fix the interaction between linker redefined symbols and ThinLTO 2017-07-06 19:58:26 +00:00
LibDriver [llvm-ar] Make llvm-lib behave more like the MSVC archiver 2017-06-12 19:45:35 +00:00
Linker [Linker] Add directives to support mixing ARM/Thumb module-level inline asm. 2017-07-12 11:52:28 +00:00
MC [AMDGPU] resubmit r308179: CodeGen: check dst operand type to determine if omod is supported for VOP3 instructions 2017-07-18 14:23:26 +00:00
Object [llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human readable form. 2017-07-14 16:00:16 +00:00
ObjectYAML [codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueId 2017-07-17 23:59:44 +00:00
Other [PM/LCG] Teach the LazyCallGraph to maintain reference edges from every 2017-07-15 08:08:19 +00:00
SafepointIRVerifier [SafepointIRVerifier] Avoid false positives in GC verifier for compare between pointers 2017-07-07 13:02:29 +00:00
SymbolRewriter
TableGen Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
ThinLTO/X86 Bitcode: Write the irsymtab to disk. 2017-06-27 23:50:11 +00:00
Transforms [x86, CGP] increase memcmp() expansion up to 4 load pairs 2017-07-18 15:55:30 +00:00
Unit Change remaining references to lit.util.capture to use subprocess.check_output. 2017-07-06 21:46:47 +00:00
Verifier Add element atomic memset intrinsic 2017-07-12 21:57:23 +00:00
YAMLParser
tools Revert "Adding temporary debugging info to llvm-mt to solve fedora failure." 2017-07-18 03:38:04 +00:00
.clang-format
CMakeLists.txt Create empty shell of llvm-mt. 2017-07-17 21:35:12 +00:00
TestRunner.sh
lit.cfg Change remaining references to lit.util.capture to use subprocess.check_output. 2017-07-06 21:46:47 +00:00
lit.site.cfg.in Introduce the new feature "abi-breaking-checks" to satisfy -reverse-iterate in llvm/test/Transforms/Util/PredicateInfo/ 2017-06-07 00:22:52 +00:00