1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib
Sanjay Patel 494e59d7bc [LibCallSimplifier] try harder to fold memcmp with constant arguments
Try to fold:
memcmp(X, C, ConstantLength) == 0 --> load X == *C

Without this change, we're unnecessarily checking the alignment of the constant data, 
so we miss the transform in the first 2 tests in the patch.

I noted this shortcoming of LibCallSimpifier in one of the recent CGP memcmp expansion 
patches. This doesn't help the example in:
https://bugs.llvm.org/show_bug.cgi?id=34032#c13
...directly, but it's worth short-circuiting more of these simple cases since we're 
already trying to do that.

The benefit of transforming to load+cmp is that existing IR analysis/transforms may
further simplify that code. For example, if the load of the variable is common to 
multiple memcmp calls, CSE can remove the duplicate instructions.

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

llvm-svn: 311333
2017-08-21 13:55:49 +00:00
..
Analysis [Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-18 23:51:26 +00:00
AsmParser Add strictfp attribute to prevent unwanted optimizations of libm calls 2017-08-14 21:15:13 +00:00
BinaryFormat
Bitcode Move helper classes into anonymous namespaces. 2017-08-20 13:03:48 +00:00
CodeGen Move helper classes into anonymous namespaces. 2017-08-20 13:03:48 +00:00
DebugInfo Move helper classes into anonymous namespaces. 2017-08-20 13:03:48 +00:00
Demangle
ExecutionEngine [ORC] Add case statements for AArch64 to the local stub and callback manager 2017-08-15 18:10:19 +00:00
Fuzzer Get rid of even more "%T" expansions, see <https://reviews.llvm.org/D35396>. 2017-08-20 17:05:22 +00:00
IR Move helper classes into anonymous namespaces. 2017-08-20 13:03:48 +00:00
IRReader
LineEditor
Linker Linker: Create a function declaration when moving a non-prevailing alias of function type. 2017-08-10 01:07:44 +00:00
LTO Fix thinlto cache key computation for cfi-icall. 2017-08-09 23:24:07 +00:00
MC [AsmParser] Recommit: Hash is not a comment on some targets 2017-08-21 09:58:37 +00:00
Object [MachO] Use Twines more efficiently. 2017-08-20 15:13:39 +00:00
ObjectYAML Move helper classes into anonymous namespaces. 2017-08-20 13:03:48 +00:00
Option
Passes [PM] Switch the CGSCC debug messages to use the standard LLVM debug 2017-08-11 05:47:13 +00:00
ProfileData
Support [ARM][AArch64] Cortex-A75 and Cortex-A55 support 2017-08-21 08:43:06 +00:00
TableGen
Target [PowerPC] Check if the pre-increment PHI Node already exists 2017-08-21 13:36:18 +00:00
Testing
ToolDrivers [dlltool] Make memory buffer ownership less weird. 2017-08-20 13:03:32 +00:00
Transforms [LibCallSimplifier] try harder to fold memcmp with constant arguments 2017-08-21 13:55:49 +00:00
WindowsManifest llvm-mt: Merge manifest namespaces. 2017-08-19 00:37:41 +00:00
XRay [XRay][tools] Support new kinds of instrumentation map entries 2017-08-21 00:14:06 +00:00
CMakeLists.txt
LLVMBuild.txt