@@ -158,9 +158,9 @@ define void @merge_store_ranges(ptr %p) {
158
158
define void @partially_overlapping_stores_branches (ptr %p , i1 %i ) {
159
159
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
160
160
; CHECK-LABEL: define void @partially_overlapping_stores_branches(
161
- ; CHECK-SAME: ptr nocapture initializes((4, 8)) [[P:%.*]], i1 [[I:%.*]]) #[[ATTR3:[0-9]+ ]] {
161
+ ; CHECK-SAME: ptr nocapture initializes((4, 8)) [[P:%.*]], i1 [[I:%.*]]) #[[ATTR1 ]] {
162
162
; CHECK-NEXT: entry:
163
- ; CHECK-NEXT: [[A:%.*]] = load i32, ptr [[P]]
163
+ ; CHECK-NEXT: [[A:%.*]] = load i32, ptr [[P]], align 4
164
164
; CHECK-NEXT: [[G:%.*]] = getelementptr i8, ptr [[P]], i64 4
165
165
; CHECK-NEXT: br i1 [[I]], label [[BB1:%.*]], label [[BB2:%.*]]
166
166
; CHECK: bb1:
@@ -382,12 +382,20 @@ define void @call_initializes_escape_bundle(ptr %p) {
382
382
}
383
383
384
384
define void @access_bundle () {
385
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
386
+ ; CHECK-LABEL: define void @access_bundle(
387
+ ; CHECK-SAME: ) #[[ATTR3:[0-9]+]] {
388
+ ; CHECK-NEXT: [[SINK:%.*]] = alloca i64, align 8
389
+ ; CHECK-NEXT: store i64 123, ptr [[SINK]], align 4
390
+ ; CHECK-NEXT: ret void
391
+ ;
385
392
%sink = alloca i64 , align 8
386
393
store i64 123 , ptr %sink
387
394
ret void
388
395
}
389
396
390
397
define void @call_operand_bundle (ptr %p ) {
398
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
391
399
; CHECK-LABEL: define void @call_operand_bundle(
392
400
; CHECK-SAME: ptr [[P:%.*]]) #[[ATTR4:[0-9]+]] {
393
401
; CHECK-NEXT: call void @access_bundle() [ "unknown"(ptr [[P]]) ]
@@ -437,7 +445,7 @@ define void @memset_neg(ptr %p) {
437
445
define void @memset_volatile (ptr %p ) {
438
446
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: write)
439
447
; CHECK-LABEL: define void @memset_volatile(
440
- ; CHECK-SAME: ptr writeonly [[P:%.*]]) #[[ATTR3 :[0-9]+]] {
448
+ ; CHECK-SAME: ptr writeonly [[P:%.*]]) #[[ATTR5 :[0-9]+]] {
441
449
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[P]], i8 2, i64 9, i1 true)
442
450
; CHECK-NEXT: ret void
443
451
;
@@ -472,7 +480,7 @@ define void @memcpy(ptr %p, ptr %p2) {
472
480
define void @memcpy_volatile (ptr %p , ptr %p2 ) {
473
481
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite)
474
482
; CHECK-LABEL: define void @memcpy_volatile(
475
- ; CHECK-SAME: ptr writeonly [[P:%.*]], ptr readonly [[P2:%.*]]) #[[ATTR4 :[0-9]+]] {
483
+ ; CHECK-SAME: ptr writeonly [[P:%.*]], ptr readonly [[P2:%.*]]) #[[ATTR6 :[0-9]+]] {
476
484
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr [[P]], ptr [[P2]], i64 9, i1 true)
477
485
; CHECK-NEXT: ret void
478
486
;
@@ -535,7 +543,7 @@ define void @memmove(ptr %p, ptr %p2) {
535
543
define void @memmove_volatile (ptr %p , ptr %p2 ) {
536
544
; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite)
537
545
; CHECK-LABEL: define void @memmove_volatile(
538
- ; CHECK-SAME: ptr writeonly [[P:%.*]], ptr readonly [[P2:%.*]]) #[[ATTR4:[0-9]+ ]] {
546
+ ; CHECK-SAME: ptr writeonly [[P:%.*]], ptr readonly [[P2:%.*]]) #[[ATTR6 ]] {
539
547
; CHECK-NEXT: call void @llvm.memmove.p0.p0.i64(ptr [[P]], ptr [[P2]], i64 9, i1 true)
540
548
; CHECK-NEXT: ret void
541
549
;
@@ -581,3 +589,25 @@ define void @memmove_non_constant(ptr %p, ptr %p2, i64 %i) {
581
589
call void @llvm.memmove (ptr %p , ptr %p2 , i64 %i , i1 false )
582
590
ret void
583
591
}
592
+
593
+ define void @callee_byval (ptr byval (i32 ) %p ) {
594
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
595
+ ; CHECK-LABEL: define void @callee_byval(
596
+ ; CHECK-SAME: ptr nocapture writeonly byval(i32) initializes((0, 4)) [[P:%.*]]) #[[ATTR0]] {
597
+ ; CHECK-NEXT: store i32 0, ptr [[P]], align 4
598
+ ; CHECK-NEXT: ret void
599
+ ;
600
+ store i32 0 , ptr %p
601
+ ret void
602
+ }
603
+
604
+ define void @caller_byval (ptr %p ) {
605
+ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
606
+ ; CHECK-LABEL: define void @caller_byval(
607
+ ; CHECK-SAME: ptr nocapture readonly [[P:%.*]]) #[[ATTR0]] {
608
+ ; CHECK-NEXT: call void @callee_byval(ptr byval(i32) [[P]])
609
+ ; CHECK-NEXT: ret void
610
+ ;
611
+ call void @callee_byval (ptr byval (i32 ) %p )
612
+ ret void
613
+ }
0 commit comments