@@ -58,7 +58,7 @@ void test_sub(int* __indexable A, int N) {
58
58
// OPT-REM-NEXT: Function: test_shl
59
59
// OPT-REM-NEXT: Args:
60
60
// OPT-REM-NEXT: - String: 'Annotated '
61
- // OPT-REM-NEXT: - count: '2 '
61
+ // OPT-REM-NEXT: - count: '3 '
62
62
// OPT-REM-NEXT: - String: ' instructions with '
63
63
// OPT-REM-NEXT: - type: bounds-safety-missed-optimization-nuw
64
64
// OPT-REM-NEXT: ...
@@ -229,23 +229,26 @@ void test_sub(int* __indexable A, int N) {
229
229
// OPT-REM-NEXT: Function: test_shl
230
230
// OPT-REM-NEXT: Args:
231
231
// OPT-REM-NEXT: - String: 'Inserted '
232
- // OPT-REM-NEXT: - count: '4 '
232
+ // OPT-REM-NEXT: - count: '5 '
233
233
// OPT-REM-NEXT: - String: ' LLVM IR instruction'
234
234
// OPT-REM-NEXT: - String: s
235
235
// OPT-REM-NEXT: - String: "\n"
236
236
// OPT-REM-NEXT: - String: "used for:\n"
237
- // OPT-REM-NEXT: - String: bounds-safety-check-ptr-lt-upper-bound, bounds-safety-check-ptr-ge-lower-bound
237
+ // OPT-REM-NEXT: - String: bounds-safety-missed-optimization-nuw, bounds-safety- check-ptr-lt-upper-bound, bounds-safety-check-ptr-ge-lower-bound
238
238
// OPT-REM-NEXT: - String: |
239
239
// OPT-REM-NEXT: {{^[ ]+$}}
240
240
// OPT-REM-NEXT: {{^[ ]+$}}
241
241
// OPT-REM-NEXT: instructions:
242
242
// OPT-REM-EMPTY:
243
243
// OPT-REM-NEXT: - String: |
244
+ // OPT-REM-NEXT: other (LLVM IR 'shl')
244
245
// OPT-REM-NEXT: cmp ult (LLVM IR 'icmp')
245
246
// OPT-REM-NEXT: cmp uge (LLVM IR 'icmp')
246
247
// OPT-REM-NEXT: and (LLVM IR 'and')
247
248
// OPT-REM-NEXT: cond branch (LLVM IR 'br')
248
249
// OPT-REM-EMPTY:
250
+ // OPT-REM-NEXT: - String: "Missed Optimization Info\n"
251
+ // OPT-REM-NEXT: - String: Check can not be removed because the arithmetic operation might wrap in the unsigned sense. Optimize the check by adding conditions to check for overflow before doing the operation
249
252
// OPT-REM-NEXT: ...
250
253
251
254
// OPT-REM-NEXT: --- !Analysis
@@ -269,7 +272,7 @@ void test_sub(int* __indexable A, int N) {
269
272
// OPT-REM-NEXT: Function: test_mul
270
273
// OPT-REM-NEXT: Args:
271
274
// OPT-REM-NEXT: - String: 'Annotated '
272
- // OPT-REM-NEXT: - count: '2 '
275
+ // OPT-REM-NEXT: - count: '3 '
273
276
// OPT-REM-NEXT: - String: ' instructions with '
274
277
// OPT-REM-NEXT: - type: bounds-safety-missed-optimization-nuw
275
278
// OPT-REM-NEXT: ...
@@ -440,24 +443,25 @@ void test_sub(int* __indexable A, int N) {
440
443
// OPT-REM-NEXT: Function: test_mul
441
444
// OPT-REM-NEXT: Args:
442
445
// OPT-REM-NEXT: - String: 'Inserted '
443
- // OPT-REM-NEXT: - count: '4 '
446
+ // OPT-REM-NEXT: - count: '5 '
444
447
// OPT-REM-NEXT: - String: ' LLVM IR instruction'
445
448
// OPT-REM-NEXT: - String: s
446
449
// OPT-REM-NEXT: - String: "\n"
447
450
// OPT-REM-NEXT: - String: "used for:\n"
448
- // OPT-REM-NEXT: - String: bounds-safety-check-ptr-lt-upper-bound, bounds-safety-check-ptr-ge-lower-bound
451
+ // OPT-REM-NEXT: - String: bounds-safety-missed-optimization-nuw, bounds-safety- check-ptr-lt-upper-bound, bounds-safety-check-ptr-ge-lower-bound
449
452
// OPT-REM-NEXT: - String: |
450
453
// OPT-REM-NEXT: {{^[ ]+$}}
451
454
// OPT-REM-NEXT: {{^[ ]+$}}
452
455
// OPT-REM-NEXT: instructions:
453
456
// OPT-REM-EMPTY:
454
457
// OPT-REM-NEXT: - String: |
458
+ // OPT-REM-NEXT: other (LLVM IR 'shl')
455
459
// OPT-REM-NEXT: cmp ult (LLVM IR 'icmp')
456
460
// OPT-REM-NEXT: cmp uge (LLVM IR 'icmp')
457
461
// OPT-REM-NEXT: and (LLVM IR 'and')
458
462
// OPT-REM-NEXT: cond branch (LLVM IR 'br')
459
463
// OPT-REM-EMPTY:
460
- // OPT-REM-NEXT : ...
464
+ // OPT-REM: ...
461
465
462
466
// OPT-REM-NEXT: --- !Analysis
463
467
// OPT-REM-NEXT: Pass: annotation-remarks
@@ -493,7 +497,7 @@ void test_sub(int* __indexable A, int N) {
493
497
// OPT-REM-NEXT: Function: test_add
494
498
// OPT-REM-NEXT: Args:
495
499
// OPT-REM-NEXT: - String: 'Annotated '
496
- // OPT-REM-NEXT: - count: '4 '
500
+ // OPT-REM-NEXT: - count: '2 '
497
501
// OPT-REM-NEXT: - String: ' instructions with '
498
502
// OPT-REM-NEXT: - type: bounds-safety-check-ptr-lt-upper-bound
499
503
// OPT-REM-NEXT: ...
@@ -506,7 +510,7 @@ void test_sub(int* __indexable A, int N) {
506
510
// OPT-REM-NEXT: Function: test_add
507
511
// OPT-REM-NEXT: Args:
508
512
// OPT-REM-NEXT: - String: 'Annotated '
509
- // OPT-REM-NEXT: - count: '4 '
513
+ // OPT-REM-NEXT: - count: '2 '
510
514
// OPT-REM-NEXT: - String: ' instructions with '
511
515
// OPT-REM-NEXT: - type: bounds-safety-check-ptr-ge-lower-bound
512
516
// OPT-REM-NEXT: ...
@@ -519,7 +523,7 @@ void test_sub(int* __indexable A, int N) {
519
523
// OPT-REM-NEXT: Function: test_add
520
524
// OPT-REM-NEXT: Args:
521
525
// OPT-REM-NEXT: - String: 'Annotated '
522
- // OPT-REM-NEXT: - count: '13 '
526
+ // OPT-REM-NEXT: - count: '9 '
523
527
// OPT-REM-NEXT: - String: ' instructions with '
524
528
// OPT-REM-NEXT: - type: bounds-safety-total-summary
525
529
// OPT-REM-NEXT: ...
@@ -643,33 +647,6 @@ void test_sub(int* __indexable A, int N) {
643
647
// OPT-REM-NEXT: - String: "trap (LLVM IR 'call')\nother (LLVM IR 'unreachable')"
644
648
// OPT-REM-NEXT: ...
645
649
646
- // OPT-REM-NEXT: --- !Analysis
647
- // OPT-REM-NEXT: Pass: annotation-remarks
648
- // OPT-REM-NEXT: Name: BoundsSafetyCheck
649
- // OPT-REM-NEXT: DebugLoc: { File: '{{.*}}bounds-safety-missed-binop-overflow.c',
650
- // OPT-REM-NEXT: Line: 29, Column: 11 }
651
- // OPT-REM-NEXT: Function: test_add
652
- // OPT-REM-NEXT: Args:
653
- // OPT-REM-NEXT: - String: 'Inserted '
654
- // OPT-REM-NEXT: - count: '4'
655
- // OPT-REM-NEXT: - String: ' LLVM IR instruction'
656
- // OPT-REM-NEXT: - String: s
657
- // OPT-REM-NEXT: - String: "\n"
658
- // OPT-REM-NEXT: - String: "used for:\n"
659
- // OPT-REM-NEXT: - String: bounds-safety-check-ptr-lt-upper-bound, bounds-safety-check-ptr-ge-lower-bound
660
- // OPT-REM-NEXT: - String: |
661
- // OPT-REM-NEXT: {{^[ ]+$}}
662
- // OPT-REM-NEXT: {{^[ ]+$}}
663
- // OPT-REM-NEXT: instructions:
664
- // OPT-REM-EMPTY:
665
- // OPT-REM-NEXT: - String: |
666
- // OPT-REM-NEXT: cmp ult (LLVM IR 'icmp')
667
- // OPT-REM-NEXT: cmp uge (LLVM IR 'icmp')
668
- // OPT-REM-NEXT: and (LLVM IR 'and')
669
- // OPT-REM-NEXT: cond branch (LLVM IR 'br')
670
- // OPT-REM-EMPTY:
671
- // OPT-REM-NEXT: ...
672
-
673
650
// OPT-REM-NEXT: --- !Analysis
674
651
// OPT-REM-NEXT: Pass: annotation-remarks
675
652
// OPT-REM-NEXT: Name: AnnotationSummary
0 commit comments