Skip to content

Commit f8f741c

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6-beta.1 [skip ci]
1 parent 6a0f9b5 commit f8f741c

File tree

9 files changed

+69
-31
lines changed

9 files changed

+69
-31
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
;; Test if the callee_type metadata attached to indirect call sites adhere to the expected format.
2+
3+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
4+
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 signext %x) !type !0 {
5+
entry:
6+
%func.addr = alloca ptr, align 8
7+
%x.addr = alloca i8, align 1
8+
store ptr %func, ptr %func.addr, align 8
9+
store i8 %x, ptr %x.addr, align 1
10+
%fptr = load ptr, ptr %func.addr, align 8
11+
%x_val = load i8, ptr %x.addr, align 1
12+
; CHECK: %call = call i32 %fptr(i8 signext %x_val), !callee_type !1
13+
%call = call i32 %fptr(i8 signext %x_val), !callee_type !1
14+
ret i32 %call
15+
}
16+
17+
declare !type !2 i32 @_Z3barc(i8 signext)
18+
19+
!0 = !{i64 0, !"_ZTSFiPvcE.generalized"}
20+
!1 = !{!2}
21+
!2 = !{i64 0, !"_ZTSFicE.generalized"}
22+
!3 = !{i64 0, !"_ZTSFicE"}
23+
!4 = !{!3}
24+
!8 = !{i64 0, !"_ZTSFicE.generalized"}

llvm/test/CodeGen/AArch64/callsite-emit-calleetypeid-tailcall.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; computed as the type id from the callee_type metadata.
66
; RUN: llc --call-graph-section -mtriple aarch64-linux-gnu < %s -stop-after=finalize-isel -o - | FileCheck %s
77

8-
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
8+
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) !type !0 {
99
entry:
1010
; CHECK: callSites:
1111
; CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], calleeTypeIds:

llvm/test/CodeGen/ARM/callsite-emit-calleetypeid-tailcall.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; computed as the type id from the callee_type metadata.
66
; RUN: llc --call-graph-section -mtriple arm-linux-gnu < %s -stop-after=finalize-isel -o - | FileCheck %s
77

8-
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
8+
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) !type !0 {
99
entry:
1010
; CHECK: callSites:
1111
; CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], calleeTypeIds:

llvm/test/CodeGen/Mips/callsite-emit-calleetypeid-tailcall.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; computed as the type id from the callee_type metadata.
66
; RUN: llc --call-graph-section -mtriple=mips-linux-gnu < %s -stop-after=finalize-isel -o - | FileCheck %s
77

8-
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
8+
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) !type !0 {
99
entry:
1010
; CHECK: callSites:
1111
; CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], calleeTypeIds:

llvm/test/CodeGen/RISCV/callsite-emit-calleetypeid-tailcall.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
; RUN: llc --call-graph-section -mtriple riscv64 < %s -stop-after=finalize-isel -o - | FileCheck %s
77
; RUN: llc --call-graph-section -mtriple riscv32 < %s -stop-after=finalize-isel -o - | FileCheck %s
88

9-
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
9+
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) !type !0 {
1010
entry:
1111
; CHECK: callSites:
1212
; CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], calleeTypeIds:

llvm/test/CodeGen/X86/callsite-emit-calleetypeid-tailcall.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; computed as the type id from the callee_type metadata.
66
; RUN: llc --call-graph-section -mtriple=x86_64-unknown-linux < %s -stop-after=finalize-isel -o - | FileCheck %s
77

8-
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
8+
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) !type !0 {
99
entry:
1010
; CHECK: callSites:
1111
; CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], calleeTypeIds:
Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
12
;; Test if the callee_type metadata is dropped when it is
23
;; is mapped to a direct function call from an indirect call during inlining.
34

4-
; RUN: opt -passes="inline" -S < %s | FileCheck %s
5+
; RUN: opt -passes=inline -S < %s | FileCheck %s
56

6-
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
7+
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) !type !0 {
8+
; CHECK-LABEL: define i32 @_Z13call_indirectPFicEc(
9+
; CHECK-SAME: ptr [[FUNC:%.*]], i8 [[X:%.*]]) !type [[META0:![0-9]+]] {
10+
; CHECK-NEXT: [[ENTRY:.*:]]
11+
; CHECK-NEXT: [[CALL:%.*]] = call i32 [[FUNC]](i8 [[X]]), !callee_type [[META1:![0-9]+]]
12+
; CHECK-NEXT: ret i32 [[CALL]]
13+
;
714
entry:
815
%call = call i32 %func(i8 %x), !callee_type !1
916
ret i32 %call
1017
}
1118

12-
define i32 @_Z3barv() local_unnamed_addr !type !3 {
19+
define i32 @_Z3barv() !type !3 {
20+
; CHECK-LABEL: define i32 @_Z3barv(
21+
; CHECK-SAME: ) !type [[META3:![0-9]+]] {
22+
; CHECK-NEXT: [[ENTRY:.*:]]
23+
; CHECK-NEXT: [[CALL_I:%.*]] = call i32 @_Z3fooc(i8 97)
24+
; CHECK-NEXT: ret i32 [[CALL_I]]
25+
;
1326
entry:
14-
; CHECK-LABEL: define i32 @_Z3barv()
15-
; CHECK-NEXT: entry:
16-
; CHECK-NOT: !callee_type
17-
; CHECK-NEXT: %call.i = call i32 @_Z3fooc(i8 97)
1827
%call = call i32 @_Z13call_indirectPFicEc(ptr nonnull @_Z3fooc, i8 97)
1928
ret i32 %call
2029
}
@@ -24,3 +33,9 @@ declare !type !2 i32 @_Z3fooc(i8 signext)
2433
!1 = !{!2}
2534
!2 = !{i64 0, !"_ZTSFicE.generalized"}
2635
!3 = !{i64 0, !"_ZTSFivE.generalized"}
36+
;.
37+
; CHECK: [[META0]] = !{i64 0, !"_ZTSFiPvcE.generalized"}
38+
; CHECK: [[META1]] = !{[[META2:![0-9]+]]}
39+
; CHECK: [[META2]] = !{i64 0, !"_ZTSFicE.generalized"}
40+
; CHECK: [[META3]] = !{i64 0, !"_ZTSFivE.generalized"}
41+
;.
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
12
;; Test if the callee_type metadata is dropped when it is attached
23
;; to a direct function call during instcombine.
34

4-
; RUN: opt -passes="instcombine" -S < %s | FileCheck %s
5+
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
56

6-
define i32 @_Z3barv() local_unnamed_addr !type !3 {
7+
define i32 @_Z3barv() !type !3 {
8+
; CHECK-LABEL: define i32 @_Z3barv(
9+
; CHECK-SAME: ) !type [[META0:![0-9]+]] {
10+
; CHECK-NEXT: [[ENTRY:.*:]]
11+
; CHECK-NEXT: [[CALL:%.*]] = call i32 @_Z3fooc(i8 97)
12+
; CHECK-NEXT: ret i32 [[CALL]]
13+
;
714
entry:
8-
; CHECK-LABEL: define i32 @_Z3barv()
9-
; CHECK-NEXT: entry:
10-
; CHECK-NOT: !callee_type
11-
; CHECK-NEXT: %call = call i32 @_Z3fooc(i8 97)
1215
%call = call i32 @_Z3fooc(i8 97), !callee_type !1
1316
ret i32 %call
1417
}
@@ -19,3 +22,6 @@ declare !type !2 i32 @_Z3fooc(i8 signext)
1922
!1 = !{!2}
2023
!2 = !{i64 0, !"_ZTSFicE.generalized"}
2124
!3 = !{i64 0, !"_ZTSFivE.generalized"}
25+
;.
26+
; CHECK: [[META0]] = !{i64 0, !"_ZTSFivE.generalized"}
27+
;.
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
11
;; Test if the callee_type metadata attached to indirect call sites adhere to the expected format.
22

3-
; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s
3+
; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
44
define i32 @_Z13call_indirectPFicEc(ptr %func, i8 signext %x) !type !0 {
55
entry:
66
%func.addr = alloca ptr, align 8
77
%x.addr = alloca i8, align 1
88
store ptr %func, ptr %func.addr, align 8
99
store i8 %x, ptr %x.addr, align 1
1010
%fptr = load ptr, ptr %func.addr, align 8
11-
%x_val = load i8, ptr %x.addr, align 1
12-
;; No failures expected for this callee_type metdata.
13-
%call = call i32 %fptr(i8 signext %x_val), !callee_type !1
11+
%x_val = load i8, ptr %x.addr, align 1
1412
;; callee_type metdata is a type metadata instead of a list of type metadata nodes.
1513
; CHECK: The callee_type metadata must be a list of type metadata nodes
16-
%call2 = call i32 %fptr(i8 signext %x_val), !callee_type !0
14+
%call = call i32 %fptr(i8 signext %x_val), !callee_type !0
1715
;; callee_type metdata must be a list of "generalized" type metadata.
1816
; CHECK: Only generalized type metadata can be part of the callee_type metadata list
19-
%call3 = call i32 %fptr(i8 signext %x_val), !callee_type !4
17+
%call2 = call i32 %fptr(i8 signext %x_val), !callee_type !2
2018
ret i32 %call
2119
}
2220

23-
declare !type !2 i32 @_Z3barc(i8 signext)
24-
2521
!0 = !{i64 0, !"_ZTSFiPvcE.generalized"}
26-
!1 = !{!2}
27-
!2 = !{i64 0, !"_ZTSFicE.generalized"}
28-
!3 = !{i64 0, !"_ZTSFicE"}
29-
!4 = !{!3}
30-
!8 = !{i64 0, !"_ZTSFicE.generalized"}
22+
!1 = !{i64 0, !"_ZTSFicE"}
23+
!2 = !{!1}

0 commit comments

Comments
 (0)