Skip to content

Commit 47bc0ac

Browse files
paperchaliceLukacma
authored andcommitted
[test][BPF] Remove unsafe-fp-math uses (NFC) (llvm#164784)
Post cleanup for llvm#164534. Also pick suggestion by nikic, remove redundant attributes.
1 parent 00cbb3d commit 47bc0ac

File tree

120 files changed

+525
-1033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+525
-1033
lines changed

llvm/test/CodeGen/BPF/BTF/binary-format.ll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
; clang -target bpf -O2 -g -gdwarf-5 -gembed-source -S -emit-llvm t.c
88

99
; Function Attrs: nounwind readnone
10-
define dso_local i32 @f(i32 returned %a) local_unnamed_addr #0 !dbg !7 {
10+
define dso_local i32 @f(i32 returned %a) local_unnamed_addr !dbg !7 {
1111
entry:
1212
call void @llvm.dbg.value(metadata i32 %a, metadata !12, metadata !DIExpression()), !dbg !13
1313
ret i32 %a, !dbg !14
@@ -42,10 +42,7 @@ entry:
4242
; CHECK-EB: 0x00000050 00000008 0000000f 00000018 00000410
4343

4444
; Function Attrs: nounwind readnone speculatable
45-
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
46-
47-
attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
48-
attributes #1 = { nounwind readnone speculatable }
45+
declare void @llvm.dbg.value(metadata, metadata, metadata)
4946

5047
!llvm.dbg.cu = !{!0}
5148
!llvm.module.flags = !{!3, !4, !5}

llvm/test/CodeGen/BPF/BTF/builtin-btf-type-id.ll

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@bpf_log = internal global ptr inttoptr (i64 999 to ptr), align 8, !dbg !17
2525

2626
; Function Attrs: nounwind
27-
define dso_local void @prog1() #0 !dbg !28 {
27+
define dso_local void @prog1() !dbg !28 {
2828
entry:
2929
%0 = load ptr, ptr @bpf_log, align 8, !dbg !31, !tbaa !32
3030
%1 = call i64 @llvm.bpf.btf.type.id(i32 0, i64 0), !dbg !36, !llvm.preserve.access.index !7
@@ -33,10 +33,10 @@ entry:
3333
}
3434

3535
; Function Attrs: nounwind readnone
36-
declare i64 @llvm.bpf.btf.type.id(i32, i64) #1
36+
declare i64 @llvm.bpf.btf.type.id(i32, i64)
3737

3838
; Function Attrs: nounwind
39-
define dso_local void @prog2() #0 !dbg !38 {
39+
define dso_local void @prog2() !dbg !38 {
4040
entry:
4141
%0 = load ptr, ptr @bpf_log, align 8, !dbg !39, !tbaa !32
4242
%1 = call i64 @llvm.bpf.btf.type.id(i32 1, i64 0), !dbg !40, !llvm.preserve.access.index !6
@@ -45,7 +45,7 @@ entry:
4545
}
4646

4747
; Function Attrs: nounwind
48-
define dso_local void @prog3() #0 !dbg !42 {
48+
define dso_local void @prog3() !dbg !42 {
4949
entry:
5050
%0 = load ptr, ptr @bpf_log, align 8, !dbg !43, !tbaa !32
5151
%1 = call i64 @llvm.bpf.btf.type.id(i32 2, i64 1), !dbg !44, !llvm.preserve.access.index !11
@@ -96,9 +96,6 @@ entry:
9696
; CHECK-NEXT: .long 48
9797
; CHECK-NEXT: .long 7
9898

99-
attributes #0 = { nounwind "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
100-
attributes #1 = { nounwind readnone }
101-
10299
!llvm.dbg.cu = !{!2}
103100
!llvm.module.flags = !{!24, !25, !26}
104101
!llvm.ident = !{!27}

llvm/test/CodeGen/BPF/BTF/char-no-debuginfo.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@
1010
@g = dso_local local_unnamed_addr global i32 5, section "maps", align 4
1111

1212
; Function Attrs: norecurse nounwind readonly
13-
define dso_local i32 @test() local_unnamed_addr #0 {
13+
define dso_local i32 @test() local_unnamed_addr {
1414
%1 = load i32, ptr @g, align 4, !tbaa !2
1515
ret i32 %1
1616
}
1717

1818
; CHECK-NOT: .section .BTF
1919
; CHECK-NOT: .section .BTF.ext
2020

21-
attributes #0 = { norecurse nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
22-
2321
!llvm.module.flags = !{!0}
2422
!llvm.ident = !{!1}
2523

llvm/test/CodeGen/BPF/BTF/extern-builtin.ll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
; clang -target bpf -O2 -g -S -emit-llvm test.c
1111

1212
; Function Attrs: nounwind readonly
13-
define dso_local i64 @test(ptr readonly %skb) local_unnamed_addr #0 !dbg !13 {
13+
define dso_local i64 @test(ptr readonly %skb) local_unnamed_addr !dbg !13 {
1414
entry:
1515
call void @llvm.dbg.value(metadata ptr %skb, metadata !17, metadata !DIExpression()), !dbg !18
1616
%call = tail call i64 @llvm.bpf.load.byte(ptr %skb, i64 10), !dbg !19
@@ -54,13 +54,9 @@ entry:
5454
; CHECK-NEXT: .byte 0
5555

5656
; Function Attrs: nounwind readonly
57-
declare !dbg !4 i64 @llvm.bpf.load.byte(ptr, i64) #1
57+
declare !dbg !4 i64 @llvm.bpf.load.byte(ptr, i64)
5858
; Function Attrs: nounwind readnone speculatable willreturn
59-
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
60-
61-
attributes #0 = { nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
62-
attributes #1 = { nounwind readonly }
63-
attributes #2 = { nounwind readnone speculatable willreturn }
59+
declare void @llvm.dbg.value(metadata, metadata, metadata)
6460

6561
!llvm.dbg.cu = !{!0}
6662
!llvm.module.flags = !{!9, !10, !11}

llvm/test/CodeGen/BPF/BTF/extern-func-arg.ll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
; clang -target bpf -O2 -g -S -emit-llvm test.c
99

1010
; Function Attrs: nounwind
11-
define dso_local i32 @test() local_unnamed_addr #0 !dbg !13 {
11+
define dso_local i32 @test() local_unnamed_addr !dbg !13 {
1212
entry:
13-
%call = tail call i32 @global_func(i8 signext 0) #2, !dbg !16
13+
%call = tail call i32 @global_func(i8 signext 0), !dbg !16
1414
ret i32 %call, !dbg !17
1515
}
1616

@@ -49,11 +49,7 @@ entry:
4949
; CHECK: .ascii "char" # string offset=55
5050
; CHECK: .ascii "global_func" # string offset=60
5151

52-
declare !dbg !4 dso_local i32 @global_func(i8 signext) local_unnamed_addr #1
53-
54-
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
55-
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
56-
attributes #2 = { nounwind }
52+
declare !dbg !4 dso_local i32 @global_func(i8 signext) local_unnamed_addr
5753

5854
!llvm.dbg.cu = !{!0}
5955
!llvm.module.flags = !{!9, !10, !11}

llvm/test/CodeGen/BPF/BTF/extern-global-var.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@a = external dso_local local_unnamed_addr global i8, align 1
1111

1212
; Function Attrs: norecurse nounwind readonly
13-
define dso_local i32 @foo() local_unnamed_addr #0 !dbg !7 {
13+
define dso_local i32 @foo() local_unnamed_addr !dbg !7 {
1414
%1 = load i8, ptr @a, align 1, !dbg !11, !tbaa !12
1515
%2 = sext i8 %1 to i32, !dbg !11
1616
ret i32 %2, !dbg !15
@@ -45,8 +45,6 @@ define dso_local i32 @foo() local_unnamed_addr #0 !dbg !7 {
4545
; CHECK-NEXT: .ascii "/home/yhs/work/tests/llvm/bug/test.c" # string offset=15
4646
; CHECK-NEXT: .byte 0
4747

48-
attributes #0 = { norecurse nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
49-
5048
!llvm.dbg.cu = !{!0}
5149
!llvm.module.flags = !{!3, !4, !5}
5250
!llvm.ident = !{!6}

llvm/test/CodeGen/BPF/BTF/extern-var-func-weak-section.ll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
; clang -target bpf -O2 -g -S -emit-llvm test.c
1111

1212
; Function Attrs: nounwind
13-
define dso_local i32 @test() local_unnamed_addr #0 !dbg !13 {
13+
define dso_local i32 @test() local_unnamed_addr !dbg !13 {
1414
entry:
15-
%call = tail call i32 @global_func(i8 signext 0) #2, !dbg !16
15+
%call = tail call i32 @global_func(i8 signext 0), !dbg !16
1616
ret i32 %call, !dbg !17
1717
}
18-
declare !dbg !4 extern_weak dso_local i32 @global_func(i8 signext) local_unnamed_addr #1 section "abc"
18+
declare !dbg !4 extern_weak dso_local i32 @global_func(i8 signext) local_unnamed_addr section "abc"
1919

2020
; CHECK: .section .BTF,"",@progbits
2121
; CHECK-NEXT: .short 60319 # 0xeb9f
@@ -69,10 +69,6 @@ declare !dbg !4 extern_weak dso_local i32 @global_func(i8 signext) local_unnamed
6969
; CHECK-NEXT: .byte 0
7070
; CHECK-NEXT: .ascii "abc" # string offset=72
7171

72-
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
73-
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
74-
attributes #2 = { nounwind }
75-
7672
!llvm.dbg.cu = !{!0}
7773
!llvm.module.flags = !{!9, !10, !11}
7874
!llvm.ident = !{!12}

llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
; clang -target bpf -O2 -g -S -emit-llvm test.c
1111

1212
; Function Attrs: nounwind
13-
define dso_local i32 @test() local_unnamed_addr #0 !dbg !13 {
13+
define dso_local i32 @test() local_unnamed_addr !dbg !13 {
1414
entry:
15-
%call = tail call i32 @global_func(i8 signext 0) #2, !dbg !16
15+
%call = tail call i32 @global_func(i8 signext 0), !dbg !16
1616
ret i32 %call, !dbg !17
1717
}
18-
declare !dbg !4 extern_weak dso_local i32 @global_func(i8 signext) local_unnamed_addr #1
18+
declare !dbg !4 extern_weak dso_local i32 @global_func(i8 signext) local_unnamed_addr
1919

2020
; CHECK: .section .BTF,"",@progbits
2121
; CHECK-NEXT: .short 60319 # 0xeb9f
@@ -62,10 +62,6 @@ declare !dbg !4 extern_weak dso_local i32 @global_func(i8 signext) local_unnamed
6262
; CHECK-NEXT: .ascii "global_func" # string offset=60
6363
; CHECK-NEXT: .byte 0
6464

65-
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
66-
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
67-
attributes #2 = { nounwind }
68-
6965
!llvm.dbg.cu = !{!0}
7066
!llvm.module.flags = !{!9, !10, !11}
7167
!llvm.ident = !{!12}

llvm/test/CodeGen/BPF/BTF/extern-var-func.ll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
; clang -target bpf -O2 -g -S -emit-llvm test.c
1111

1212
; Function Attrs: nounwind
13-
define dso_local i32 @test() local_unnamed_addr #0 !dbg !13 {
13+
define dso_local i32 @test() local_unnamed_addr !dbg !13 {
1414
entry:
15-
%call = tail call i32 @global_func(i8 signext 0) #2, !dbg !16
15+
%call = tail call i32 @global_func(i8 signext 0), !dbg !16
1616
ret i32 %call, !dbg !17
1717
}
1818

@@ -61,11 +61,7 @@ entry:
6161
; CHECK-NEXT: .ascii "global_func" # string offset=60
6262
; CHECK-NEXT: .byte 0
6363

64-
declare !dbg !4 dso_local i32 @global_func(i8 signext) local_unnamed_addr #1
65-
66-
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
67-
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
68-
attributes #2 = { nounwind }
64+
declare !dbg !4 dso_local i32 @global_func(i8 signext) local_unnamed_addr
6965

7066
!llvm.dbg.cu = !{!0}
7167
!llvm.module.flags = !{!9, !10, !11}

llvm/test/CodeGen/BPF/BTF/extern-var-section.ll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
@ch = external dso_local local_unnamed_addr global i8, section "abc", align 1, !dbg !0
1414

1515
; Function Attrs: nounwind
16-
define dso_local i32 @test() local_unnamed_addr #0 !dbg !16 {
16+
define dso_local i32 @test() local_unnamed_addr !dbg !16 {
1717
entry:
18-
%call = tail call i32 @global_func(i8 signext 0) #2, !dbg !19
18+
%call = tail call i32 @global_func(i8 signext 0), !dbg !19
1919
%0 = load i8, ptr @ch, align 1, !dbg !20, !tbaa !21
2020
%conv = sext i8 %0 to i32, !dbg !20
2121
%add = add nsw i32 %call, %conv, !dbg !24
@@ -84,11 +84,7 @@ entry:
8484
; CHECK-NEXT: .ascii "abc" # string offset=75
8585
; CHECK-NEXT: .byte 0
8686

87-
declare !dbg !6 dso_local i32 @global_func(i8 signext) local_unnamed_addr #1 section "abc"
88-
89-
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
90-
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
91-
attributes #2 = { nounwind }
87+
declare !dbg !6 dso_local i32 @global_func(i8 signext) local_unnamed_addr section "abc"
9288

9389
!llvm.dbg.cu = !{!2}
9490
!llvm.module.flags = !{!12, !13, !14}

0 commit comments

Comments
 (0)