summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/float16-declarations.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert r337456: [CodeGen] Disable aggressive structor optimizations at -O0, ↵Chandler Carruth2018-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | take 3 This commit increases the number of sections and overall output size of .o files by 10% and sometimes a bit more. This alone is challenging for some users, but it also appears to trigger an as-yet unexplained behavior in the Gold linker where the memory usage increases considerably more than 10% (we think). The increase is also frustrating because in many (if not all) cases we end up with almost all of the growth coming from the ELF overhead of -ffunction-sections and such, not from actual extra code being emitted. Richard Smith and Eric Christopher are both going to investigate this and try to get to the bottom of what is triggering this and whether the kinds of increases here are sustainable or what options we might have to minimize the impact they have. However, this is currently breaking a pretty large number of our users' builds so reverting it while we sort out how to make progress here. I've seen a longer and more detailed update to the commit thread. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338209 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Disable aggressive structor optimizations at -O0, take 3Pavel Labath2018-07-191-1/+1
| | | | | | | | | | | | The previous version of this patch (r332839) was reverted because it was causing "definition with same mangled name as another definition" errors in some module builds. This was caused by an unrelated bug in module importing which it exposed. The importing problem was fixed in r336240, so this recommits the original patch (r332839). Differential Revision: https://reviews.llvm.org/D46685 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337456 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r332839.Richard Smith2018-05-301-1/+1
| | | | | | | | This is causing miscompiles and "definition with same mangled name as another definition" errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333482 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Disable aggressive structor optimizations at -O0, take 2Pavel Labath2018-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The first version of the patch (r332228) was flawed because it was putting structors into C5/D5 comdats very eagerly. This is correct only if we can ensure the comdat contains all required versions of the structor (which wasn't the case). This version uses a more nuanced approach: - for local structor symbols we use an alias because we don't have to worry about comdats or other compilation units. - linkonce symbols are emitted separately, as we cannot guarantee we will have all symbols we need to form a comdat (they are emitted lazily, only when referenced). - available_externally symbols are also emitted separately, as the code seemed to be worried about emitting an alias in this case. - other linkage types are not affected by the optimization level. They either get put into a comdat (weak) or get aliased (external). Reviewers: rjmccall, aprantl Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46685 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332839 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[CodeGen] Disable aggressive structor optimizations at -O0"Pavel Labath2018-05-141-1/+1
| | | | | | | | | It breaks the sanitizer build <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/23739> This reverts commit r332228. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332232 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Disable aggressive structor optimizations at -O0Pavel Labath2018-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Removing the full structor and replacing all usages with the base one can degrade debug quality as it will leave the debugger unable to locate the full object structor. This is apparent when evaluating an expression in the debugger which requires constructing an object of class which has had this optimization applied to it. When compiling the expression, we pretend that the class and its methods have been defined in another compilation unit, so the expression compiler assumes the structor definition must be available. This didn't use to be the case for structors with internal linkage. Less aggressive optimizations like emitting the full structor as an alias remain in place, as they do not cause the structor symbol to disappear completely. This improves debug quality on non-darwin platforms (darwin does not have -mconstructor-aliases on by default, so it is spared these problems) and enable us to remove some workarounds from LLDB which attempt to mitigate this issue. Reviewers: rjmccall, aprantl Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46685 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332228 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r324107 again.Rafael Espindola2018-02-071-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The difference from the previous try is that we no longer directly access function declarations from position independent executables. It should work, but currently doesn't with some linkers. It now includes a fix to not mark available_externally definitions as dso_local. Original message: Start setting dso_local in clang. This starts adding dso_local to clang. The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go away. My objective for now is to move enough of it to clang to remove the need for the TargetMachine one to handle PIE copy relocations and -fno-plt. With that it should then be easy to implement a -fno-copy-reloc in clang. This patch just adds the cases where we assume a symbol to be local based on the file being compiled for an executable or a shared library. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324535 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Recommit r324107."Rafael Espindola2018-02-071-11/+11
| | | | | | | | | | | | | | This reverts commit r324500. The bots found two failures: ThreadSanitizer-x86_64 :: Linux/pie_no_aslr.cc ThreadSanitizer-x86_64 :: pie_test.cc when using gold. The issue is a limitation in gold when building pie binaries. I will investigate how to work around it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324505 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r324107.Rafael Espindola2018-02-071-11/+11
| | | | | | | | | | | | | | | | | | | | | | | It now includes a fix to not mark available_externally definitions as dso_local. Original message: Start setting dso_local in clang. This starts adding dso_local to clang. The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go away. My objective for now is to move enough of it to clang to remove the need for the TargetMachine one to handle PIE copy relocations and -fno-plt. With that it should then be easy to implement a -fno-copy-reloc in clang. This patch just adds the cases where we assume a symbol to be local based on the file being compiled for an executable or a shared library. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324500 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Start setting dso_local in clang."Rafael Espindola2018-02-021-11/+11
| | | | | | | | This reverts commit r324107. I will have to test it on OS X. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324108 91177308-0d34-0410-b5e6-96231b3b80d8
* Start setting dso_local in clang.Rafael Espindola2018-02-021-11/+11
| | | | | | | | | | | | | | | | This starts adding dso_local to clang. The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go away. My objective for now is to move enough of it to clang to remove the need for the TargetMachine one to handle PIE copy relocations and -fno-plt. With that it should then be easy to implement a -fno-copy-reloc in clang. This patch just adds the cases where we assume a symbol to be local based on the file being compiled for an executable or a shared library. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324107 91177308-0d34-0410-b5e6-96231b3b80d8
* Change memcpy/memove/memset to have dest and source alignment attributes ↵Daniel Neilson2018-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | (Step 1). Summary: Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset intrinsics. This change updates the Clang tests for this change. The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument which is required to be a constant integer. It represents the alignment of the dest (and source), and so must be the minimum of the actual alignment of the two. This change removes the alignment argument in favour of placing the alignment attribute on the source and destination pointers of the memory intrinsic call. For example, code which used to read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false) will now read call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false) At this time the source and destination alignments must be the same (Step 1). Step 2 of the change, to be landed shortly, will relax that contraint and allow the source and destination to have different alignments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322964 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen][X86] Fix handling of __fp16 vectors.Akira Hatanaka2017-12-091-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug in IRGen where it generates completely broken code for __fp16 vectors on X86. For example when the following code is compiled: half4 hv0, hv1, hv2; // these are vectors of __fp16. void foo221() { hv0 = hv1 + hv2; } clang generates the following IR, in which two i16 vectors are added: @hv1 = common global <4 x i16> zeroinitializer, align 8 @hv2 = common global <4 x i16> zeroinitializer, align 8 @hv0 = common global <4 x i16> zeroinitializer, align 8 define void @foo221() { %0 = load <4 x i16>, <4 x i16>* @hv1, align 8 %1 = load <4 x i16>, <4 x i16>* @hv2, align 8 %add = add <4 x i16> %0, %1 store <4 x i16> %add, <4 x i16>* @hv0, align 8 ret void } To fix the bug, this commit uses the code committed in r314056, which modified clang to promote and truncate __fp16 vectors to and from float vectors in the AST. It also fixes another IRGen bug where a short value is assigned to an __fp16 variable without any integer-to-floating-point conversion, as shown in the following example: __fp16 a; short b; void foo1() { a = b; } @b = common global i16 0, align 2 @a = common global i16 0, align 2 define void @foo1() #0 { %0 = load i16, i16* @b, align 2 store i16 %0, i16* @a, align 2 ret void } rdar://problem/20625184 Differential Revision: https://reviews.llvm.org/D40112 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320215 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-0/+156
| | | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312794 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-156/+0
| | | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312784 91177308-0d34-0410-b5e6-96231b3b80d8
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-081-0/+156
This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312781 91177308-0d34-0410-b5e6-96231b3b80d8