Skip to content

Commit ef5b2a5

Browse files
pkwasnie-inteligcbot
authored andcommitted
refactor payloadHeader implicit kernel argument
IGC contains two versions of implicit kernel argument payloadHeader: 1. 8 x i32 packing global_id_offset (3 x i32), local_size (3 x i32) and 2 x i32 reserved. 2. 3 x i32 packing only global_id_offset (3 x i32) This commit refactors payloadHeader.
1 parent 91d5830 commit ef5b2a5

File tree

261 files changed

+635
-637
lines changed

Some content is hidden

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

261 files changed

+635
-637
lines changed

IGC/AdaptorCommon/ImplicitArgs.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static const std::vector<ImplicitArg> IMPLICIT_ARGS = {
2525
ImplicitArg(ImplicitArg::R0, "r0", ImplicitArg::INT, WIAnalysis::UNIFORM_THREAD, 8, ImplicitArg::ALIGN_GRF, false, GenISAIntrinsic::GenISA_getR0),
2626

2727
ImplicitArg(ImplicitArg::PAYLOAD_HEADER, "payloadHeader", ImplicitArg::INT, WIAnalysis::UNIFORM_WORKGROUP, 8, ImplicitArg::ALIGN_GRF, true, GenISAIntrinsic::GenISA_getPayloadHeader),
28+
ImplicitArg(ImplicitArg::PAYLOAD_HEADER_SHORT, "payloadHeader", ImplicitArg::INT, WIAnalysis::UNIFORM_WORKGROUP, 3, ImplicitArg::ALIGN_DWORD, true, GenISAIntrinsic::GenISA_getPayloadHeader),
2829
ImplicitArg(ImplicitArg::WORK_DIM, "workDim", ImplicitArg::INT, WIAnalysis::UNIFORM_GLOBAL, 1, ImplicitArg::ALIGN_DWORD, true, GenISAIntrinsic::GenISA_getWorkDim),
2930

3031
ImplicitArg(ImplicitArg::NUM_GROUPS, "numWorkGroups", ImplicitArg::INT, WIAnalysis::UNIFORM_GLOBAL, 3, ImplicitArg::ALIGN_DWORD, true, GenISAIntrinsic::GenISA_getNumWorkGroups),
@@ -104,8 +105,6 @@ static const std::vector<ImplicitArg> IMPLICIT_ARGS = {
104105

105106
// BufferBoundsChecking
106107
ImplicitArg(ImplicitArg::BUFFER_SIZE, "bufferSize", ImplicitArg::LONG, WIAnalysis::UNIFORM_GLOBAL, 1, ImplicitArg::ALIGN_QWORD, true),
107-
108-
ImplicitArg(ImplicitArg::PAYLOAD_HEADER_SHORT, "payloadHeader", ImplicitArg::INT, WIAnalysis::UNIFORM_WORKGROUP, 3, ImplicitArg::ALIGN_DWORD, true, GenISAIntrinsic::GenISA_getPayloadHeader),
109108
};
110109

111110
ImplicitArg::ImplicitArg(

IGC/AdaptorCommon/ImplicitArgs.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ namespace IGC
3838
R0,
3939
START_ID = R0,
4040
PAYLOAD_HEADER,
41+
PAYLOAD_HEADER_SHORT, // reduces PayloadHeader to 3xi32
4142

4243
// WI information
4344
WORK_DIM,
@@ -130,8 +131,6 @@ namespace IGC
130131
// BufferBoundsChecking
131132
BUFFER_SIZE,
132133

133-
PAYLOAD_HEADER_SHORT,
134-
135134
NUM_IMPLICIT_ARGS
136135
};
137136

IGC/Compiler/tests/AddImplicitArgs/rti-typed-pointers.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ declare i32 addrspace(1)* @llvm.genx.GenISA.InlinedData(i16)
5252
!1 = !{!2, !3}
5353
!2 = !{!"function_type", i32 0}
5454
!3 = !{!"implicit_arg_desc", !4, !5, !6, !7}
55-
!4 = !{i32 54}
56-
!5 = !{i32 55}
57-
!6 = !{i32 57}
58-
!7 = !{i32 56}
55+
!4 = !{i32 55}
56+
!5 = !{i32 56}
57+
!6 = !{i32 58}
58+
!7 = !{i32 57}
5959
!8 = !{void ()* @rti, !1}
6060
!9 = !{void ()* @foo, !1}

IGC/Compiler/tests/AddImplicitArgs/rti.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ declare ptr addrspace(1) @llvm.genx.GenISA.InlinedData(i16)
5353
!1 = !{!2, !3}
5454
!2 = !{!"function_type", i32 0}
5555
!3 = !{!"implicit_arg_desc", !4, !5, !6, !7}
56-
!4 = !{i32 54}
57-
!5 = !{i32 55}
58-
!6 = !{i32 57}
59-
!7 = !{i32 56}
56+
!4 = !{i32 55}
57+
!5 = !{i32 56}
58+
!6 = !{i32 58}
59+
!7 = !{i32 57}
6060
!8 = !{ptr @rti, !1}
6161
!9 = !{ptr @foo, !1}

IGC/Compiler/tests/AddImplicitArgs/signatiure_changed_GlobalSize-typed-pointers.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ define i32 @foo(i32 %x) nounwind {
1919
!2 = !{ !"function_type", i32 0}
2020
!3 = !{ !"arg_desc"}
2121
!4 = !{ !"implicit_arg_desc", !6}
22-
!6 = !{i32 4}
22+
!6 = !{i32 5}
2323

2424
; CHECK: define i32 @foo(i32 %x, <3 x i32> %globalSize)
2525
; CHECK-NOT: define i32 @foo(i32 %x)

IGC/Compiler/tests/AddImplicitArgs/signatiure_changed_GlobalSize.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ define i32 @foo(i32 %x) nounwind {
2020
!2 = !{ !"function_type", i32 0}
2121
!3 = !{ !"arg_desc"}
2222
!4 = !{ !"implicit_arg_desc", !6}
23-
!6 = !{i32 4}
23+
!6 = !{i32 5}
2424

2525
; CHECK: define i32 @foo(i32 %x, <3 x i32> %globalSize)
2626
; CHECK-NOT: define i32 @foo(i32 %x)

IGC/Compiler/tests/AddImplicitArgs/signatiure_changed_LocaIdsl-typed-pointers.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ define i32 @foo(i32 %x) nounwind {
1919
!2 = !{ !"function_type", i32 0}
2020
!3 = !{ !"arg_desc"}
2121
!4 = !{ !"implicit_arg_desc", !6, !7, !8}
22-
!6 = !{i32 7}
23-
!7 = !{i32 8}
24-
!8 = !{i32 9}
22+
!6 = !{i32 8}
23+
!7 = !{i32 9}
24+
!8 = !{i32 10}
2525

2626
; CHECK: define i32 @foo(i32 %x, i16 %localIdX, i16 %localIdY, i16 %localIdZ)
2727
; CHECK-NOT: define i32 @foo(i32 %x)

IGC/Compiler/tests/AddImplicitArgs/signatiure_changed_LocaIdsl.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ define i32 @foo(i32 %x) nounwind {
2020
!2 = !{ !"function_type", i32 0}
2121
!3 = !{ !"arg_desc"}
2222
!4 = !{ !"implicit_arg_desc", !6, !7, !8}
23-
!6 = !{i32 7}
24-
!7 = !{i32 8}
25-
!8 = !{i32 9}
23+
!6 = !{i32 8}
24+
!7 = !{i32 9}
25+
!8 = !{i32 10}
2626

2727
; CHECK: define i32 @foo(i32 %x, i16 %localIdX, i16 %localIdY, i16 %localIdZ)
2828
; CHECK-NOT: define i32 @foo(i32 %x)

IGC/Compiler/tests/AddImplicitArgs/signatiure_changed_NumWorkGroups-typed-pointers.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ define i32 @foo(i32 %x) nounwind {
1919
!2 = !{ !"function_type", i32 0}
2020
!3 = !{ !"arg_desc"}
2121
!4 = !{ !"implicit_arg_desc", !6}
22-
!6 = !{i32 3}
22+
!6 = !{i32 4}
2323

2424
; CHECK: define i32 @foo(i32 %x, <3 x i32> %numWorkGroups)
2525
; CHECK-NOT: define i32 @foo(i32 %x)

IGC/Compiler/tests/AddImplicitArgs/signatiure_changed_NumWorkGroups.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ define i32 @foo(i32 %x) nounwind {
2020
!2 = !{ !"function_type", i32 0}
2121
!3 = !{ !"arg_desc"}
2222
!4 = !{ !"implicit_arg_desc", !6}
23-
!6 = !{i32 3}
23+
!6 = !{i32 4}
2424

2525
; CHECK: define i32 @foo(i32 %x, <3 x i32> %numWorkGroups)
2626
; CHECK-NOT: define i32 @foo(i32 %x)

0 commit comments

Comments
 (0)