llvm-project/clang/test
Benjamin Kramer 3d8aa5c77d CodeGen: Emit constant temporaries into read-only globals.
Instead of creating a copy on the stack just stash them in a private
constant global. This saves both the copying overhead and the stack
space, and gives the optimizer more room to constant fold.

This tries to make array temporaries more similar to regular arrays,
they can't use the same logic because a temporary has no VarDecl to be
bound to so we roll our own version here.

The original use case for this optimization was code like
  for (int i : {1, 2, 3, 4, 5, 6, 7, 8, 10})
    foo(i);
where without this patch (assuming that the loop is not unrolled) we
would alloca an array on the stack, copy the 10 values over and
iterate on that. With this patch we put the array in .text use it
directly. Apart from that case this helps on virtually any passing of
a constant std::initializer_list as a function argument.

Differential Revision: http://reviews.llvm.org/D8034

llvm-svn: 231508
2015-03-06 20:00:03 +00:00
..
ARCMT Revert r231008 (and dependent r231019). 2015-03-03 10:02:53 +00:00
ASTMerge
Analysis [analyzer] Bug fix: do not report leaks for alloca() 2015-03-04 23:18:21 +00:00
CXX Update Clang tests to handle explicitly typed load changes in LLVM. 2015-02-27 21:19:58 +00:00
CodeCompletion
CodeGen Revert "[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent." 2015-03-05 21:57:35 +00:00
CodeGenCUDA Update Clang tests to handle explicitly typed load changes in LLVM. 2015-02-27 21:19:58 +00:00
CodeGenCXX CodeGen: Emit constant temporaries into read-only globals. 2015-03-06 20:00:03 +00:00
CodeGenObjC DebugInfo: Move new hierarchy into place (clang) 2015-03-03 17:25:55 +00:00
CodeGenObjCXX DebugInfo: Move new hierarchy into place (clang) 2015-03-03 17:25:55 +00:00
CodeGenOpenCL Restores r228382, which was reverted in r228406. 2015-02-25 05:48:23 +00:00
Coverage clang/test/Coverage/html-diagnostics.c: Use find(1) to avoid globbing. 2014-11-04 13:05:10 +00:00
CoverageMapping InstrProf: Make sure counts in lambdas don't escape to the parent scope 2015-02-24 04:13:56 +00:00
Driver Revert "[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent." 2015-03-05 21:57:35 +00:00
FixIt Use the real CXXScopeSpec when setting the correction SourceRange. 2015-01-28 00:46:09 +00:00
Format
Frontend Fix typo in my last commit. 2015-03-03 00:12:08 +00:00
Headers Restore the libc++ definition of max_align_t on Apple platforms 2015-02-24 01:06:22 +00:00
Index [ASTUnit] Fix crash when trying to load a module file via ASTUnit::LoadFromASTFile. 2015-03-03 08:04:19 +00:00
Integration
Layout PR6037 2015-01-19 01:44:02 +00:00
Lexer Add -fuse-line-directive flag to control usage of #line with -E 2015-02-26 00:17:25 +00:00
Misc Fix test case. 2015-03-02 21:47:47 +00:00
Modules [modules] Rework merging of redeclaration chains on module import. 2015-03-05 23:24:12 +00:00
OpenMP Update Clang tests to handle explicitly typed load changes in LLVM. 2015-02-27 21:19:58 +00:00
PCH Try to unbreak the Windows buildbots. 2015-03-03 23:36:57 +00:00
Parser [PowerPC]Activate "vector bool long long" (and alternate spellings) as a valid type for Altivec support for Power. 2015-03-03 20:08:43 +00:00
Preprocessor Add Clang support for PPC cryptography builtins 2015-03-04 21:48:22 +00:00
Profile Add -frtti/-fexceptions to some more tests that assume they're on 2015-02-26 18:29:41 +00:00
Rewriter Give some obj-c rewriter tests that use MS pragmas a triple as a speculative fix 2015-03-05 00:04:18 +00:00
Sema Support __attribute__((availability)) on Android. 2015-03-03 18:28:38 +00:00
SemaCUDA CUDA: Add option to allow host device functions to call host functions 2015-02-24 21:45:33 +00:00
SemaCXX Sema: The i8 suffix should yield a literal of type char 2015-03-06 18:04:22 +00:00
SemaObjC New ObjC warning: circular containers. 2015-03-04 17:55:52 +00:00
SemaObjCXX Update error message text. 2015-01-18 19:05:48 +00:00
SemaOpenCL Restores r228382, which was reverted in r228406. 2015-02-25 05:48:23 +00:00
SemaTemplate Revert "Improve declaration / expression disambiguation around ptr-operators, and use" 2015-02-23 22:36:28 +00:00
TableGen
Tooling Remove "REQUIRES:shell" from tests. They work for me. 2014-11-04 13:41:33 +00:00
Unit
VFS DebugInfo: Move new hierarchy into place (clang) 2015-03-03 17:25:55 +00:00
.clang-format
CMakeLists.txt Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
Makefile Fix makefile for debuginfo-tests execution. 2014-10-17 23:50:47 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg Check for backtraces in tests which are verifying pretty stack traces from a crashing clang. 2015-02-10 19:53:38 +00:00
lit.site.cfg.in Check for backtraces in tests which are verifying pretty stack traces from a crashing clang. 2015-02-10 19:53:38 +00:00
make_test_dirs.pl