Skip to content

Commit baa51a0

Browse files
committed
[Tests] Add missing willreturn attributes (NFC)
To retain the spirit of these tests after an upcoming change to mayHaveSideEffect(), add willreturn attributes to a number of functions.
1 parent 0339fcc commit baa51a0

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

llvm/test/Transforms/LICM/funclet.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@ else: ; preds = %postinvoke
157157

158158
declare void @may_throw()
159159

160-
declare i32 @pure_computation() nounwind argmemonly readonly
160+
declare i32 @pure_computation() nounwind argmemonly readonly willreturn
161161

162162
declare i32 @__CxxFrameHandler3(...)

llvm/test/Transforms/LICM/sinking.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; RUN: opt < %s -basic-aa -licm -S -enable-mssa-loop-dependency=true -verify-memoryssa | FileCheck %s
44

55

6-
declare i32 @strlen(i8*) readonly nounwind
6+
declare i32 @strlen(i8*) readonly nounwind willreturn
77

88
declare void @foo()
99

@@ -27,7 +27,7 @@ Out: ; preds = %Loop
2727
ret i32 %A
2828
}
2929

30-
declare double @sin(double) readnone nounwind
30+
declare double @sin(double) readnone nounwind willreturn
3131

3232
; Sink readnone function out of loop with unknown memory behavior.
3333
define double @test2(double %X) {

llvm/test/Transforms/SCCP/calltest.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt < %s -sccp -loop-deletion -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
33

4-
declare double @sqrt(double) readnone nounwind
4+
declare double @sqrt(double) readnone nounwind willreturn
55
%empty = type {}
66
declare %empty @has_side_effects()
77

llvm/test/Transforms/SCCP/musttail-call.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ define internal i8* @side_effects(i8 %v) {
5959
}
6060

6161
; The call to this function is removed, so the return value must be zapped
62-
define internal i8* @no_side_effects(i8 %v) readonly nounwind {
62+
define internal i8* @no_side_effects(i8 %v) readonly nounwind willreturn {
6363
; CHECK-LABEL: define {{[^@]+}}@no_side_effects
6464
; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
6565
; CHECK-NEXT: ret i8* undef

llvm/test/Transforms/SCCP/remove-call-inst.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ entry:
1515
ret i32 %call2
1616
}
1717

18-
define internal i32 @wwrite(i64 %i) nounwind readnone {
18+
define internal i32 @wwrite(i64 %i) nounwind readnone willreturn {
1919
; CHECK-LABEL: @wwrite(
2020
; CHECK-NEXT: entry:
2121
; CHECK-NEXT: br label [[SW_DEFAULT:%.*]]
@@ -36,4 +36,4 @@ return:
3636
}
3737

3838
; CHECK: attributes #0 = { noreturn nounwind }
39-
; CHECK: attributes #1 = { nounwind readnone }
39+
; CHECK: attributes #1 = { nounwind readnone willreturn }

llvm/test/Transforms/TailCallElim/reorder_load.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1515

1616
; This load can be moved above the call because the function won't write to it
1717
; and the call has no side effects.
18-
define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly {
18+
define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
1919
; CHECK-LABEL: @raise_load_1(
2020
; CHECK-NEXT: entry:
2121
; CHECK-NEXT: br label [[TAILRECURSE:%.*]]
@@ -99,7 +99,7 @@ recurse: ; preds = %else
9999

100100
; This load can be safely moved above the call (even though it's from an
101101
; extern_weak global) because the call has no side effects.
102-
define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly {
102+
define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
103103
; CHECK-LABEL: @raise_load_3(
104104
; CHECK-NEXT: entry:
105105
; CHECK-NEXT: br label [[TAILRECURSE:%.*]]

0 commit comments

Comments
 (0)