Skip to content

Commit 0557af2

Browse files
committed
[InstCombine] Preserve !annotation on newly created instructions.
If the source instruction has !annotation metadata, all instructions created during combining should also have it. Tell the builder to add it. The !annotation system was discussed on llvm-dev as part of 'RFC: Combining Annotation Metadata and Remarks' (http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html) This patch is based on an earlier patch by Francis Visoiu Mistrih. Reviewed By: thegameg, lebedev.ri Differential Revision: https://reviews.llvm.org/D91444
1 parent 56e56e9 commit 0557af2

File tree

3 files changed

+50
-91
lines changed

3 files changed

+50
-91
lines changed

clang/test/CodeGenCXX/auto-var-init.cpp

Lines changed: 33 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,7 @@ TEST_UNINIT(empty, empty);
597597
// PATTERN-O1: store i8 [[I8]], {{.*}} align 1, !annotation [[AUTO_INIT]]
598598
// ZERO-LABEL: @test_empty_uninit()
599599
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
600-
// ZERO-O1: store i8 0, {{.*}} align 1
601-
// FIXME: !annotation dropped by optimizations
602-
// ZERO-O1-NOT: !annotation
600+
// ZERO-O1: store i8 0, {{.*}} align 1, !annotation [[AUTO_INIT]]
603601

604602
TEST_BRACES(empty, empty);
605603
// CHECK-LABEL: @test_empty_braces()
@@ -618,9 +616,7 @@ TEST_UNINIT(small, small);
618616
// PATTERN-O1: store i8 [[I8]], {{.*}} align 1, !annotation [[AUTO_INIT]]
619617
// ZERO-LABEL: @test_small_uninit()
620618
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
621-
// ZERO-O1: store i8 0, {{.*}} align 1
622-
// FIXME: !annotation dropped by optimizations
623-
// ZERO-O1-NOT: !annotation
619+
// ZERO-O1: store i8 0, {{.*}} align 1, !annotation [[AUTO_INIT]]
624620

625621
TEST_BRACES(small, small);
626622
// CHECK-LABEL: @test_small_braces()
@@ -671,10 +667,8 @@ TEST_UNINIT(smallpartinit, smallpartinit);
671667
// PATTERN-O1: store i8 42, {{.*}} align 1
672668
// ZERO-LABEL: @test_smallpartinit_uninit()
673669
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
674-
// ZERO-O1-LEGACY: store i16 0, i16* %uninit, align 2
675-
// ZERO-O1-NEWPM: store i16 0, i16* %uninit, align 2
676-
// FIXME: !annotation dropped by optimizations
677-
// ZERO-O1-NOT: !annotation
670+
// ZERO-O1-LEGACY: store i16 0, i16* %uninit, align 2, !annotation [[AUTO_INIT]]
671+
// ZERO-O1-NEWPM: store i16 0, i16* %uninit, align 2, !annotation [[AUTO_INIT]]
678672

679673
TEST_BRACES(smallpartinit, smallpartinit);
680674
// CHECK-LABEL: @test_smallpartinit_braces()
@@ -726,14 +720,10 @@ TEST_UNINIT(padded, padded);
726720
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
727721
// PATTERN-LABEL: @test_padded_uninit()
728722
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_padded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
729-
// PATTERN-O1: store i64 [[I64]], i64* %uninit, align 8
730-
// FIXME: !annotation dropped by optimizations
731-
// PATTERN-O1-NOT: !annotation
723+
// PATTERN-O1: store i64 [[I64]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
732724
// ZERO-LABEL: @test_padded_uninit()
733-
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}})
734-
// ZERO-O1: store i64 0, i64* %uninit, align 8
735-
// FIXME: !annotation dropped by optimizations
736-
// ZERO-O1-NOT: !annotation
725+
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
726+
// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
737727

738728
TEST_BRACES(padded, padded);
739729
// CHECK-LABEL: @test_padded_braces()
@@ -758,15 +748,16 @@ TEST_UNINIT(paddednullinit, paddednullinit);
758748
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
759749
// PATTERN-LABEL: @test_paddednullinit_uninit()
760750
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednullinit_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
761-
// PATTERN-O1-LEGACY: store i64 [[I64]], i64* %uninit, align 8
762-
// PATTERN-O1-NEWPM: store i64 [[I64]], i64* %uninit, align 8
763-
// FIXME: !annotation dropped by optimizations
764-
// PATTERN-O1-NOT: !annotation
751+
// PATTERN-O1-LEGACY: store i64 [[I64]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
752+
// PATTERN-O1-NEWPM: store i64 [[I64]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
765753
// ZERO-LABEL: @test_paddednullinit_uninit()
766-
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,
767-
// ZERO-O1: store i64 0, i64* %uninit, align 8
754+
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.*}}, !annotation [[AUTO_INIT]]
755+
// ZERO-O1-LEGACY: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
756+
// ZERO-O1-NEWPM: store i64 0, i64* %uninit, align 8
768757
// FIXME: !annotation dropped by optimizations
769-
// ZERO-O1-NOT: !annotation
758+
// ZERO-O1-NEWPM-NOT: !annotation
759+
// ZERO: ret
760+
770761

771762
TEST_BRACES(paddednullinit, paddednullinit);
772763
// CHECK-LABEL: @test_paddednullinit_braces()
@@ -922,9 +913,7 @@ TEST_UNINIT(bitfield, bitfield);
922913
// PATTERN-O1-NOT: !annotation
923914
// ZERO-LABEL: @test_bitfield_uninit()
924915
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0{{.+}}), !annotation [[AUTO_INIT]]
925-
// ZERO-O1: store i32 0, i32* %uninit, align 4
926-
// FIXME: !annotation dropped by optimizations
927-
// ZERO-O1-NOT: !annotation
916+
// ZERO-O1: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
928917

929918
TEST_BRACES(bitfield, bitfield);
930919
// CHECK-LABEL: @test_bitfield_braces()
@@ -953,9 +942,7 @@ TEST_UNINIT(bitfieldaligned, bitfieldaligned);
953942
// PATTERN-O1-NOT: !annotation
954943
// ZERO-LABEL: @test_bitfieldaligned_uninit()
955944
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
956-
// ZERO-O1: store i64 0, i64* %uninit, align 8
957-
// FIXME: !annotation dropped by optimizations
958-
// ZERO-O1-NOT: !annotation
945+
// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
959946

960947
TEST_BRACES(bitfieldaligned, bitfieldaligned);
961948
// CHECK-LABEL: @test_bitfieldaligned_braces()
@@ -1007,9 +994,7 @@ TEST_UNINIT(arraytail, arraytail);
1007994
// PATTERN-O1: store i32 [[I32]], {{.*}} align 4, !annotation [[AUTO_INIT]]
1008995
// ZERO-LABEL: @test_arraytail_uninit()
1009996
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
1010-
// ZERO-O1: store i32 0, {{.*}} align 4
1011-
// FIXME: !annotation dropped by optimizations
1012-
// ZERO-O1-NOT: !annotation
997+
// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]
1013998

1014999
TEST_BRACES(arraytail, arraytail);
10151000
// CHECK-LABEL: @test_arraytail_braces()
@@ -1053,9 +1038,7 @@ TEST_UNINIT(int1, int[1]);
10531038
// PATTERN-O1: store i32 [[I32]], {{.*}} align 4, !annotation [[AUTO_INIT]]
10541039
// ZERO-LABEL: @test_int1_uninit()
10551040
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
1056-
// ZERO-O1: store i32 0, {{.*}} align 4
1057-
// FIXME: !annotation dropped by optimizations
1058-
// ZERO-O1-NOT: !annotation
1041+
// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]
10591042

10601043
TEST_BRACES(int1, int[1]);
10611044
// CHECK-LABEL: @test_int1_braces()
@@ -1109,9 +1092,7 @@ TEST_UNINIT(bool4, bool[4]);
11091092
// PATTERN-O1-NOT: !annotation
11101093
// ZERO-LABEL: @test_bool4_uninit()
11111094
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
1112-
// ZERO-O1: store i32 0, i32* %uninit, align 4
1113-
// FIXME: !annotation dropped by optimizations
1114-
// ZERO-O1-NOT: !annotation
1095+
// ZERO-O1: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
11151096

11161097
TEST_BRACES(bool4, bool[4]);
11171098
// CHECK-LABEL: @test_bool4_braces()
@@ -1244,7 +1225,7 @@ TEST_UNINIT(atomicnotlockfree, _Atomic(notlockfree));
12441225
// PATTERN-LABEL: @test_atomicnotlockfree_uninit()
12451226
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicnotlockfree_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
12461227
// PATTERN-O1: bitcast
1247-
// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 32
1228+
// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 32{{.*}}
12481229
// FIXME: !annotation dropped by optimizations
12491230
// PATTERN-O1-NOT: !annotation
12501231
// ZERO-LABEL: @test_atomicnotlockfree_uninit()
@@ -1256,14 +1237,10 @@ TEST_UNINIT(atomicpadded, _Atomic(padded));
12561237
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
12571238
// PATTERN-LABEL: @test_atomicpadded_uninit()
12581239
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicpadded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
1259-
// PATTERN-O1: store i64 [[IPTR]], i64* %uninit, align 8
1260-
// FIXME: !annotation dropped by optimizations
1261-
// PATTERN-O1-NOT: !annotation
1240+
// PATTERN-O1: store i64 [[IPTR]], i64* %uninit, align 8, !annotation [[AUTO_INIT]]
12621241
// ZERO-LABEL: @test_atomicpadded_uninit()
12631242
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1264-
// ZERO-O1: store i64 0, i64* %uninit, align 8
1265-
// FIXME: !annotation dropped by optimizations
1266-
// ZERO-O1-NOT: !annotation
1243+
// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
12671244

12681245
TEST_UNINIT(atomictailpad, _Atomic(tailpad));
12691246
// CHECK-LABEL: @test_atomictailpad_uninit()
@@ -1273,9 +1250,7 @@ TEST_UNINIT(atomictailpad, _Atomic(tailpad));
12731250
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomictailpad_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
12741251
// ZERO-LABEL: @test_atomictailpad_uninit()
12751252
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
1276-
// ZERO-O1: store i32 0, i32* %uninit, align 4
1277-
// FIXME: !annotation dropped by optimizations
1278-
// ZERO-O1-NOT: !annotation
1253+
// ZERO-O1: store i32 0, i32* %uninit, align 4, !annotation [[AUTO_INIT]]
12791254

12801255
TEST_UNINIT(complexfloat, _Complex float);
12811256
// CHECK-LABEL: @test_complexfloat_uninit()
@@ -1291,9 +1266,7 @@ TEST_UNINIT(complexfloat, _Complex float);
12911266

12921267
// ZERO-LABEL: @test_complexfloat_uninit()
12931268
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1294-
// ZERO-O1: store i64 0, i64* %uninit, align 8
1295-
// FIXME: !annotation dropped by optimizations
1296-
// ZERO-O1-NOT: !annotation
1269+
// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
12971270

12981271
TEST_BRACES(complexfloat, _Complex float);
12991272
// CHECK-LABEL: @test_complexfloat_braces()
@@ -1372,9 +1345,7 @@ TEST_UNINIT(semivolatile, semivolatile);
13721345
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_semivolatile_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
13731346
// ZERO-LABEL: @test_semivolatile_uninit()
13741347
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1375-
// ZERO-O1: store i64 0, i64* %uninit, align 8
1376-
// FIXME: !annotation dropped by optimizations
1377-
// ZERO-O1-NOT: !annotation
1348+
// ZERO-O1: store i64 0, i64* %uninit, align 8, !annotation [[AUTO_INIT]]
13781349

13791350
TEST_BRACES(semivolatile, semivolatile);
13801351
// CHECK-LABEL: @test_semivolatile_braces()
@@ -1433,8 +1404,7 @@ TEST_UNINIT(base, base);
14331404
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
14341405
// ZERO-O1-LEGACY: store i64 0, {{.*}} align 8
14351406
// ZERO-O1-NEWPM: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [4 x i8*] }, { [4 x i8*] }* @_ZTV4base, i64 0, inrange i32 0, i64 2) to i32 (...)**), {{.*}}, align 8
1436-
// FIXME: !annotation dropped by optimizations
1437-
// ZERO-O1-NOT: !annotation
1407+
// ZERO-O1-NOT-NEWPM: !annotation
14381408

14391409
TEST_BRACES(base, base);
14401410
// CHECK-LABEL: @test_base_braces()
@@ -1454,10 +1424,8 @@ TEST_UNINIT(derived, derived);
14541424
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_derived_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
14551425
// ZERO-LABEL: @test_derived_uninit()
14561426
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1457-
// ZERO-O1-LEGACY: store i64 0, {{.*}} align 8
1427+
// ZERO-O1: store i64 0, {{.*}} align 8, !annotation [[AUTO_INIT]]
14581428
// ZERO-O1-NEWPM: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [4 x i8*] }, { [4 x i8*] }* @_ZTV7derived, i64 0, inrange i32 0, i64 2) to i32 (...)**), {{.*}} align 8
1459-
// FIXME: !annotation dropped by optimizations
1460-
// ZERO-O1-NOT: !annotation
14611429

14621430
TEST_BRACES(derived, derived);
14631431
// CHECK-LABEL: @test_derived_braces()
@@ -1497,9 +1465,7 @@ TEST_UNINIT(matching, matching);
14971465
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_matching_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
14981466
// ZERO-LABEL: @test_matching_uninit()
14991467
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1500-
// ZERO-O1: store i32 0, {{.*}} align 4
1501-
// FIXME: !annotation dropped by optimizations
1502-
// ZERO-O1-NOT: !annotation
1468+
// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]
15031469

15041470
TEST_BRACES(matching, matching);
15051471
// CHECK-LABEL: @test_matching_braces()
@@ -1529,9 +1495,7 @@ TEST_UNINIT(matchingreverse, matchingreverse);
15291495
// PATTERN-O1: store float 0xFFFFFFFFE0000000, {{.+}}, !annotation [[AUTO_INIT]]
15301496
// ZERO-LABEL: @test_matchingreverse_uninit()
15311497
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
1532-
// ZERO-O1: store i32 0, {{.*}} align 4
1533-
// FIXME: !annotation dropped by optimizations
1534-
// ZERO-O1-NOT: !annotation
1498+
// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]
15351499

15361500
TEST_BRACES(matchingreverse, matchingreverse);
15371501
// CHECK-LABEL: @test_matchingreverse_braces()
@@ -1559,9 +1523,7 @@ TEST_UNINIT(unmatched, unmatched);
15591523
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatched_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
15601524
// ZERO-LABEL: @test_unmatched_uninit()
15611525
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1562-
// ZERO-O1: store i32 0, {{.*}} align 4
1563-
// FIXME: !annotation dropped by optimizations
1564-
// ZERO-O1-NOT: !annotation
1526+
// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]
15651527

15661528
TEST_BRACES(unmatched, unmatched);
15671529
// CHECK-LABEL: @test_unmatched_braces()
@@ -1589,9 +1551,7 @@ TEST_UNINIT(unmatchedreverse, unmatchedreverse);
15891551
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedreverse_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
15901552
// ZERO-LABEL: @test_unmatchedreverse_uninit()
15911553
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1592-
// ZERO-O1: store i32 0, {{.*}} align 4
1593-
// FIXME: !annotation dropped by optimizations
1594-
// ZERO-O1-NOT: !annotation
1554+
// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]
15951555

15961556
TEST_BRACES(unmatchedreverse, unmatchedreverse);
15971557
// CHECK-LABEL: @test_unmatchedreverse_braces()
@@ -1619,9 +1579,7 @@ TEST_UNINIT(unmatchedfp, unmatchedfp);
16191579
// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedfp_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
16201580
// ZERO-LABEL: @test_unmatchedfp_uninit()
16211581
// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
1622-
// ZERO-O1: store i64 0, {{.*}} align 8
1623-
// FIXME: !annotation dropped by optimizations
1624-
// ZERO-O1-NOT: !annotation
1582+
// ZERO-O1: store i64 0, {{.*}} align 8, !annotation [[AUTO_INIT]]
16251583

16261584
TEST_BRACES(unmatchedfp, unmatchedfp);
16271585
// CHECK-LABEL: @test_unmatchedfp_braces()

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3550,7 +3550,8 @@ bool InstCombiner::run() {
35503550

35513551
// Now that we have an instruction, try combining it to simplify it.
35523552
Builder.SetInsertPoint(I);
3553-
Builder.CollectMetadataToCopy(I, {LLVMContext::MD_dbg});
3553+
Builder.CollectMetadataToCopy(
3554+
I, {LLVMContext::MD_dbg, LLVMContext::MD_annotation});
35543555

35553556
#ifndef NDEBUG
35563557
std::string OrigI;

llvm/test/Transforms/InstCombine/annotations.ll

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) n
4949

5050
define void @copy_1_byte(i8* %d, i8* %s) {
5151
; CHECK-LABEL: define {{.+}} @copy_1_byte({{.+}}
52-
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
53-
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1
52+
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
53+
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
5454
; CHECK-NEXT: ret void
5555
;
5656
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %d, i8* %s, i32 1, i1 false), !annotation !0
@@ -61,8 +61,8 @@ declare i8* @memcpy(i8* noalias returned, i8* noalias nocapture readonly, i64) n
6161

6262
define void @libcallcopy_1_byte(i8* %d, i8* %s) {
6363
; CHECK-LABEL: define {{.+}} @libcallcopy_1_byte({{.+}}
64-
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
65-
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1
64+
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
65+
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
6666
; CHECK-NEXT: ret void
6767
;
6868
call i8* @memcpy(i8* %d, i8* %s, i64 1), !annotation !0
@@ -73,8 +73,8 @@ declare i8* @__memcpy_chk(i8*, i8*, i64, i64) nofree nounwind
7373

7474
define void @libcallcopy_1_byte_chk(i8* %d, i8* %s) {
7575
; CHECK-LABEL: define {{.+}} @libcallcopy_1_byte_chk({{.+}}
76-
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
77-
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1
76+
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
77+
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
7878
; CHECK-NEXT: ret void
7979
;
8080
call i8* @__memcpy_chk(i8* %d, i8* %s, i64 1, i64 1), !annotation !0
@@ -85,8 +85,8 @@ declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly,
8585

8686
define void @move_1_byte(i8* %d, i8* %s) {
8787
; CHECK-LABEL: define {{.+}} @move_1_byte({{.+}}
88-
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
89-
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1
88+
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
89+
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
9090
; CHECK-NEXT: ret void
9191
;
9292
call void @llvm.memmove.p0i8.p0i8.i32(i8* %d, i8* %s, i32 1, i1 false), !annotation !0
@@ -97,8 +97,8 @@ declare i8* @memmove(i8* returned, i8* nocapture readonly, i64) nofree nounwind
9797

9898
define void @libcallmove_1_byte(i8* %d, i8* %s) {
9999
; CHECK-LABEL: define {{.+}} @libcallmove_1_byte({{.+}}
100-
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
101-
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1
100+
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
101+
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
102102
; CHECK-NEXT: ret void
103103
;
104104
call i8* @memmove(i8* %d, i8* %s, i64 1), !annotation !0
@@ -109,8 +109,8 @@ declare i8* @__memmove_chk(i8*, i8*, i64, i64) nofree nounwind
109109

110110
define void @libcallmove_1_byte_chk(i8* %d, i8* %s) {
111111
; CHECK-LABEL: define {{.+}} @libcallmove_1_byte_chk({{.+}}
112-
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1
113-
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1
112+
; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* [[S:%.*]], align 1, !annotation [[ANN]]
113+
; CHECK-NEXT: store i8 [[TMP1]], i8* [[D:%.*]], align 1, !annotation [[ANN]]
114114
; CHECK-NEXT: ret void
115115
;
116116
call i8* @__memmove_chk(i8* %d, i8* %s, i64 1, i64 1), !annotation !0
@@ -121,7 +121,7 @@ declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1) argmemo
121121

122122
define void @set_1_byte(i8* %d) {
123123
; CHECK-LABEL: define {{.+}} @set_1_byte({{.+}}
124-
; CHECK-NEXT: store i8 1, i8* [[D:%.*]], align 1
124+
; CHECK-NEXT: store i8 1, i8* [[D:%.*]], align 1, !annotation [[ANN]]
125125
; CHECK-NEXT: ret void
126126
;
127127
call void @llvm.memset.p0i8.i32(i8* %d, i8 1, i32 1, i1 false), !annotation !0
@@ -132,7 +132,7 @@ declare i8* @memset(i8*, i32, i64) nofree
132132

133133
define void @libcall_set_1_byte(i8* %d) {
134134
; CHECK-LABEL: define {{.+}} @libcall_set_1_byte({{.+}}
135-
; CHECK-NEXT: store i8 1, i8* [[D:%.*]], align 1
135+
; CHECK-NEXT: store i8 1, i8* [[D:%.*]], align 1, !annotation [[ANN]]
136136
; CHECK-NEXT: ret void
137137
;
138138
call i8* @memset(i8* %d, i32 1, i64 1), !annotation !0
@@ -143,7 +143,7 @@ declare i8* @__memset_chk(i8*, i32, i64, i64) nofree
143143

144144
define void @libcall_set_1_byte_chk(i8* %d) {
145145
; CHECK-LABEL: define {{.+}} @libcall_set_1_byte_chk({{.+}}
146-
; CHECK-NEXT: store i8 1, i8* [[D:%.*]], align 1
146+
; CHECK-NEXT: store i8 1, i8* [[D:%.*]], align 1, !annotation [[ANN]]
147147
; CHECK-NEXT: ret void
148148
;
149149
call i8* @__memset_chk(i8* %d, i32 1, i64 1, i64 1), !annotation !0

0 commit comments

Comments
 (0)