Go to file
JF Bastien 6508929da9 CodeGen: use non-zero memset when possible for automatic variables
Summary:
Right now automatic variables are either initialized with bzero followed by a few stores, or memcpy'd from a synthesized global. We end up encountering a fair amount of code where memcpy of non-zero byte patterns would be better than memcpy from a global because it touches less memory and generates a smaller binary. The optimizer could reason about this, but it's not really worth it when clang already knows.

This code could definitely be more clever but I'm not sure it's worth it. In particular we could track a histogram of bytes seen and figure out (as we do with bzero) if a memset could be followed by a handful of stores. Similarly, we could tune the heuristics for GlobalSize, but using the same as for bzero seems conservatively OK for now.

<rdar://problem/42563091>

Reviewers: dexonsmith

Subscribers: cfe-commits

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

llvm-svn: 337887
2018-07-25 04:29:03 +00:00
clang CodeGen: use non-zero memset when possible for automatic variables 2018-07-25 04:29:03 +00:00
clang-tools-extra [clangd] Guard fuzzer against empty inputs. 2018-07-24 21:50:06 +00:00
compiler-rt [profile] Support profiling runtime on Fuchsia 2018-07-25 03:01:35 +00:00
debuginfo-tests Revert "[CMake] Sort dependency list and add safestack to it" 2018-07-18 20:10:43 +00:00
libclc atom: Use volatile pointers for cl_khr_{global,local}_int32_{base,extended}_atomics 2018-06-21 19:27:39 +00:00
libcxx Fix missing includes in format_string.hpp helper 2018-07-25 04:21:59 +00:00
libcxxabi [CMake] Option to control whether shared/static library is installed 2018-07-24 23:27:51 +00:00
libunwind [CMake] Include CMakeDependentOption in libunwind 2018-07-24 23:42:51 +00:00
lld Fix error messages for bad symbols. 2018-07-24 22:52:11 +00:00
lldb Add unit tests for VMRange 2018-07-24 23:52:39 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [RegisterBankInfo] Ignore InstrMappings that create impossible to repair operands 2018-07-25 03:08:35 +00:00
openmp [OPNEMP, NVPTX] Fixed sychronization construct + code cleanup. 2018-07-23 13:52:12 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly [isl] Simplify iterator implementation by building on top of list accessors 2018-07-23 15:28:50 +00:00
README.md

README.md

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.