summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/pod-member-memcpys.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change memcpy/memove/memset to have dest and source alignment attributes ↵Daniel Neilson2018-01-191-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* Revert "Change memcpy/memset/memmove to have dest and source alignments."Pete Cooper2015-11-191-34/+34
| | | | | | | | | | This reverts commit r253512. This likely broke the bots in: http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202 http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253542 91177308-0d34-0410-b5e6-96231b3b80d8
* Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper2015-11-181-34/+34
| | | | | | | | | | | | | | | | | | | | | | This is a follow on from a similar LLVM commit: r253511. Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. The only code change to clang is hidden in CGBuilder.h which now passes both dest and source alignment to IRBuilder, instead of taking the minimum of dest and source alignments. Reviewed by Hal Finkel. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253512 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230795 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit DeferredDeclsToEmit in a DFS order.Rafael Espindola2015-01-221-51/+50
| | | | | | | | | | | | | | Currently we emit DeferredDeclsToEmit in reverse order. This patch changes that. The advantages of the change are that * The output order is a bit closer to the source order. The change to test/CodeGenCXX/pod-member-memcpys.cpp is a good example. * If we decide to deffer more, it will not cause as large changes in the estcases as it would without this patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226751 91177308-0d34-0410-b5e6-96231b3b80d8
* Make test more robust to appease build botsDavid Majnemer2014-10-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219526 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: FieldMemcpyizer didn't handle copies starting inside bitfieldsDavid Majnemer2014-10-101-0/+13
| | | | | | | | | | | | | It's possible to construct cases where the first field we are trying to copy is in the middle of an IR field. In some complicated cases, we would fail to use an appropriate offset inside the object. Earlier builds of clang seemed to miscompile the code by copying an insufficient number of bytes. Up until now, we would assert: the copying offset was insufficiently aligned. This fixes PR21232. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219524 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark C++ reference parameters as dereferenceableHal Finkel2014-07-181-26/+26
| | | | | | | | | | | | | | Because references must be initialized using some evaluated expression, they must point to something, and a callee can assume the reference parameter is dereferenceable. Taking advantage of a new attribute just added to LLVM, mark them as such. Because dereferenceability in addrspace(0) implies nonnull in the backend, we don't need both attributes. However, we need to know the size of the object to use the dereferenceable attribute, so for incomplete types we still emit only nonnull. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213386 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-26/+26
| | | | | | type in a function type where the C++ type is a reference. Update the tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209723 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass -O0 to clang_cc1, it is the default.Rafael Espindola2013-09-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189910 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the test on -Asserts build.Rafael Espindola2013-09-031-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189888 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't run optimizations in a clang test.Rafael Espindola2013-09-031-49/+49
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189880 91177308-0d34-0410-b5e6-96231b3b80d8
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-18/+18
| | | | | | tests fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188447 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ASTContext::getDeclAlign(<Field Decl>) to get the alignment of the firstLang Hames2013-03-051-0/+20
| | | | | | | | | | | field to be memcpy'd, rather instead of ASTContext::getTypeAlign(<Field Type>). For packed structs the alignment of a field may be less than the alignment of the field's type. <rdar://problem/13338585> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176512 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the correct alignment for POD-member memcpys where the first field is aLang Hames2013-02-271-0/+14
| | | | | | | | | | | | | | bitfield. CGBitField::StorageAlignment holds the alignment in chars, but emitMemcpy had been treating it as if it were held in bits, leading to underaligned memcpys. Related to PR15348. Thanks very much to Chandler for the diagnosis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176163 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove block names from test case to unbreak release builds.Lang Hames2013-02-171-2/+0
| | | | | | | Thanks Chandler. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175392 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r174919 - smarter copy/move assignment/construction, with fixes forLang Hames2013-02-171-0/+224
bitfield related issues. The original commit broke Takumi's builder. The bug was caused by bitfield sizes being determined by their underlying type, rather than the field info. A similar issue with bitfield alignments showed up on closer testing. Both have been fixed in this patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175389 91177308-0d34-0410-b5e6-96231b3b80d8