summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/tbaa-struct.cpp
AgeCommit message (Collapse)Author
2025-10-21[clang][CodeGen] Emit `llvm.tbaa.errno` metadata during module creationAntonio Frighetto
Let Clang emit `llvm.tbaa.errno` metadata in order to let LLVM carry out optimizations around errno-writing libcalls to, as long as it is proved the involved memory location does not alias `errno`. Previous discussion: https://discourse.llvm.org/t/rfc-modelling-errno-memory-effects/82972.
2024-03-29[clang] Better SysV bitfield access units (#65742)Nathan Sidwell
Reimplement bitfield access unit computation for SysV ABIs. Considers expense of unaligned and non-power-of-2 accesses.
2024-03-11[TBAA] Generate tbaa.struct single field with char tag for unions. (#84370)Florian Hahn
At the moment,distinct fields for each union member are generated. When copying a union, we don't know which union member is active, so there's no benefit from recording the different fields. It can result in converting tbaa.struct fields to incorrect tbaa nodes when extracting fields. PR: https://github.com/llvm/llvm-project/pull/84370
2024-03-07[TBAA] Add extra tests to copy structs with union members.Florian Hahn
Adds extra test coverage for TBAA generation for copies of structs with union members.
2024-02-27[TBAA] Handle bitfields when generating !tbaa.struct metadata. (#82922)Florian Hahn
At the moment, clang generates what I believe are incorrect !tbaa.struct fields for named bitfields. At the moment, the base type size is used for named bifields (e.g. sizeof(int)) instead of the bifield width per field. This results in overalpping fields in !tbaa.struct metadata. This causes incorrect results when extracting individual copied fields from !tbaa.struct as in added in dc85719d5. This patch fixes that by skipping by combining adjacent bitfields in fields with correct sizes. Fixes https://github.com/llvm/llvm-project/issues/82586
2024-02-26[TBAA] Add !tbaa.struct test with unnamed bitfields.Florian Hahn
Extra tests with unnamed bitfields for https://github.com/llvm/llvm-project/pull/82922.
2024-02-26[TBAA] Add additional bitfield tests.Florian Hahn
Additional test for https://github.com/llvm/llvm-project/pull/82922/.
2024-02-25[TBAA] Test for tbaa.struct creation for struct with named bitfields.Florian Hahn
Add test for tbaa.struct metadata creation for copies of a struct with named bitfields. Test for https://github.com/llvm/llvm-project/issues/82586.
2022-10-07[CodeGen] Convert tests to opaque pointers (NFC)Nikita Popov
Conversion performed using the script at: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34 These are only tests where no manual fixup was required.
2022-04-07[OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)Nikita Popov
This adds -no-opaque-pointers to clang tests whose output will change when opaque pointers are enabled by default. This is intended to be part of the migration approach described in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9. The patch has been produced by replacing %clang_cc1 with %clang_cc1 -no-opaque-pointers for tests that fail with opaque pointers enabled. Worth noting that this doesn't cover all tests, there's a remaining ~40 tests not using %clang_cc1 that will need a followup change. Differential Revision: https://reviews.llvm.org/D123115
2021-02-20Reland "[Libcalls, Attrs] Annotate libcalls with noundef"Dávid Bolvanský
Fixed Clang tests.
2019-09-17[NFC] Updated testDavid Bolvansky
llvm-svn: 372095
2019-08-14[NFC] Updated tests after r368875David Bolvansky
llvm-svn: 368876
2019-08-13[NFC] Updated tests after r368724David Bolvansky
llvm-svn: 368725
2019-08-13[NFC] Updated tests after r368657David Bolvansky
llvm-svn: 368658
2019-06-22Fix TBAA representation for zero-sized fields and unnamed bit-fields.Richard Smith
Unnamed bit-fields should not be represented in the TBAA metadata because they do not represent storage fields (they only affect layout). Zero-sized fields should not be represented in the TBAA metadata because by definition they have no associated storage (so we will never emit a load or store through them), and they might not appear in declaration order within the struct layout. Fixes a verifier failure when emitting a TBAA-enabled load through a class type containing a zero-sized field. llvm-svn: 364140
2018-01-25[CodeGen] Decorate aggregate accesses with TBAA tagsIvan A. Kosarev
Differential Revision: https://reviews.llvm.org/D41539 llvm-svn: 323421
2018-01-19Change memcpy/memove/memset to have dest and source alignment attributes ↵Daniel Neilson
(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. llvm-svn: 322964
2015-11-19Revert "Change memcpy/memset/memmove to have dest and source alignments."Pete Cooper
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 llvm-svn: 253542
2015-11-18Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper
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. llvm-svn: 253512
2014-12-15IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith
Match LLVM changes from r224257. llvm-svn: 224259
2013-12-16Misc test cleanups.Rafael Espindola
* tbaa-struct.cpp always has a 64 bit pointer. * f32:32:32, f64:64:64 and f128:128:128 are defaults, don't assume they are printed. llvm-svn: 197415
2013-10-08TBAA: use the same format for scalar TBAA and struct-path aware TBAA.Manman Ren
An updated version of r191586 with bug fix. Struct-path aware TBAA generates tags to specify the access path, while scalar TBAA only generates tags to scalar types. We should not generate a TBAA tag with null being the first field. When a TBAA type node is null, the tag should be null too. Make sure we don't decorate an instruction with a null TBAA tag. Added a testing case for the bug reported by Richard with -relaxed-aliasing and -fsanitizer=thread. llvm-svn: 192145
2013-10-01Revert r191586 and r191695. They cause crashes when building withRichard Smith
-relaxed-aliasing. llvm-svn: 191725
2013-09-27TBAA: use the same format for scalar TBAA and struct-path aware TBAA.Manman Ren
Struct-path aware TBAA generates tags to specify the access path, while scalar TBAA only generates tags to scalar types. llvm-svn: 191586
2013-06-26Rewrite record layout for ms_struct structs.Eli Friedman
The old implementation of ms_struct in RecordLayoutBuilder was a complete mess: it depended on complicated conditionals which didn't really reflect the underlying logic, and placed a burden on users of the resulting RecordLayout. This commit rips out almost all of the old code, and replaces it with simple checks in RecordLayoutBuilder::LayoutBitField. This commit also fixes <rdar://problem/14252115>, a bug where class inheritance would cause us to lay out bitfields incorrectly. llvm-svn: 185018
2013-04-22Add triple to tbaa-struct.cpp to appease botsManman Ren
llvm-svn: 180065
2013-04-22TBAA: make sure zero-length bitfield works for tbaa.struct and path-aware tbaaManman Ren
For ms structs, zero-length bitfields following non-bitfield members are completely ignored, we should not increase the field index. Before the fix, we will have an assertion failure. llvm-svn: 180038
2013-03-21Add more testing cases for tbaa.structManman Ren
Testing cases for structs of structs and unions of structs. llvm-svn: 177612
2012-09-29clang/test/CodeGen/tbaa-struct.cpp: Fix. Be aware of 32 bit pointer.NAKAMURA Takumi
llvm-svn: 164879
2012-09-28Add basic support for adding !tbaa.struct metadata on llvm.memcpy calls forDan Gohman
struct assignment. llvm-svn: 164853