@@ -58,7 +58,7 @@ void test_sub(int* __indexable A, int N) {
5858// OPT-REM-NEXT: Function: test_shl
5959// OPT-REM-NEXT: Args:
6060// OPT-REM-NEXT: - String: 'Annotated '
61- // OPT-REM-NEXT: - count: '2 '
61+ // OPT-REM-NEXT: - count: '3 '
6262// OPT-REM-NEXT: - String: ' instructions with '
6363// OPT-REM-NEXT: - type: bounds-safety-missed-optimization-nuw
6464// OPT-REM-NEXT: ...
@@ -229,23 +229,26 @@ void test_sub(int* __indexable A, int N) {
229229// OPT-REM-NEXT: Function: test_shl
230230// OPT-REM-NEXT: Args:
231231// OPT-REM-NEXT: - String: 'Inserted '
232- // OPT-REM-NEXT: - count: '4 '
232+ // OPT-REM-NEXT: - count: '5 '
233233// OPT-REM-NEXT: - String: ' LLVM IR instruction'
234234// OPT-REM-NEXT: - String: s
235235// OPT-REM-NEXT: - String: "\n"
236236// 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
238238// OPT-REM-NEXT: - String: |
239239// OPT-REM-NEXT: {{^[ ]+$}}
240240// OPT-REM-NEXT: {{^[ ]+$}}
241241// OPT-REM-NEXT: instructions:
242242// OPT-REM-EMPTY:
243243// OPT-REM-NEXT: - String: |
244+ // OPT-REM-NEXT: other (LLVM IR 'shl')
244245// OPT-REM-NEXT: cmp ult (LLVM IR 'icmp')
245246// OPT-REM-NEXT: cmp uge (LLVM IR 'icmp')
246247// OPT-REM-NEXT: and (LLVM IR 'and')
247248// OPT-REM-NEXT: cond branch (LLVM IR 'br')
248249// 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
249252// OPT-REM-NEXT: ...
250253
251254// OPT-REM-NEXT: --- !Analysis
@@ -269,7 +272,7 @@ void test_sub(int* __indexable A, int N) {
269272// OPT-REM-NEXT: Function: test_mul
270273// OPT-REM-NEXT: Args:
271274// OPT-REM-NEXT: - String: 'Annotated '
272- // OPT-REM-NEXT: - count: '2 '
275+ // OPT-REM-NEXT: - count: '3 '
273276// OPT-REM-NEXT: - String: ' instructions with '
274277// OPT-REM-NEXT: - type: bounds-safety-missed-optimization-nuw
275278// OPT-REM-NEXT: ...
@@ -440,24 +443,25 @@ void test_sub(int* __indexable A, int N) {
440443// OPT-REM-NEXT: Function: test_mul
441444// OPT-REM-NEXT: Args:
442445// OPT-REM-NEXT: - String: 'Inserted '
443- // OPT-REM-NEXT: - count: '4 '
446+ // OPT-REM-NEXT: - count: '5 '
444447// OPT-REM-NEXT: - String: ' LLVM IR instruction'
445448// OPT-REM-NEXT: - String: s
446449// OPT-REM-NEXT: - String: "\n"
447450// 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
449452// OPT-REM-NEXT: - String: |
450453// OPT-REM-NEXT: {{^[ ]+$}}
451454// OPT-REM-NEXT: {{^[ ]+$}}
452455// OPT-REM-NEXT: instructions:
453456// OPT-REM-EMPTY:
454457// OPT-REM-NEXT: - String: |
458+ // OPT-REM-NEXT: other (LLVM IR 'shl')
455459// OPT-REM-NEXT: cmp ult (LLVM IR 'icmp')
456460// OPT-REM-NEXT: cmp uge (LLVM IR 'icmp')
457461// OPT-REM-NEXT: and (LLVM IR 'and')
458462// OPT-REM-NEXT: cond branch (LLVM IR 'br')
459463// OPT-REM-EMPTY:
460- // OPT-REM-NEXT : ...
464+ // OPT-REM: ...
461465
462466// OPT-REM-NEXT: --- !Analysis
463467// OPT-REM-NEXT: Pass: annotation-remarks
@@ -493,7 +497,7 @@ void test_sub(int* __indexable A, int N) {
493497// OPT-REM-NEXT: Function: test_add
494498// OPT-REM-NEXT: Args:
495499// OPT-REM-NEXT: - String: 'Annotated '
496- // OPT-REM-NEXT: - count: '4 '
500+ // OPT-REM-NEXT: - count: '2 '
497501// OPT-REM-NEXT: - String: ' instructions with '
498502// OPT-REM-NEXT: - type: bounds-safety-check-ptr-lt-upper-bound
499503// OPT-REM-NEXT: ...
@@ -506,7 +510,7 @@ void test_sub(int* __indexable A, int N) {
506510// OPT-REM-NEXT: Function: test_add
507511// OPT-REM-NEXT: Args:
508512// OPT-REM-NEXT: - String: 'Annotated '
509- // OPT-REM-NEXT: - count: '4 '
513+ // OPT-REM-NEXT: - count: '2 '
510514// OPT-REM-NEXT: - String: ' instructions with '
511515// OPT-REM-NEXT: - type: bounds-safety-check-ptr-ge-lower-bound
512516// OPT-REM-NEXT: ...
@@ -519,7 +523,7 @@ void test_sub(int* __indexable A, int N) {
519523// OPT-REM-NEXT: Function: test_add
520524// OPT-REM-NEXT: Args:
521525// OPT-REM-NEXT: - String: 'Annotated '
522- // OPT-REM-NEXT: - count: '13 '
526+ // OPT-REM-NEXT: - count: '9 '
523527// OPT-REM-NEXT: - String: ' instructions with '
524528// OPT-REM-NEXT: - type: bounds-safety-total-summary
525529// OPT-REM-NEXT: ...
@@ -643,33 +647,6 @@ void test_sub(int* __indexable A, int N) {
643647// OPT-REM-NEXT: - String: "trap (LLVM IR 'call')\nother (LLVM IR 'unreachable')"
644648// OPT-REM-NEXT: ...
645649
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-
673650// OPT-REM-NEXT: --- !Analysis
674651// OPT-REM-NEXT: Pass: annotation-remarks
675652// OPT-REM-NEXT: Name: AnnotationSummary
0 commit comments