Skip to content

Commit 7b6eeaf

Browse files
authored
Merge pull request #131 from frasercrmck/sub-group-analysis-clarify
[compiler] Clarify semantics of SubgroupAnalysis pass
2 parents b7bb746 + 7c656e1 commit 7b6eeaf

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

modules/compiler/test/lit/passes/sub-group-analysis.ll

+15
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,22 @@ exit:
6767
ret void
6868
}
6969

70+
; We don't consider any of the internal mux 'setters' as uses of sub-group
71+
; builtins, as they are purely there to support the framework and aren't
72+
; apparent to the user.
73+
; CHECK: Function 'function4' uses no sub-group builtins
74+
define spir_func void @function4() {
75+
call void @__mux_set_sub_group_id(i32 0)
76+
call void @__mux_set_num_sub_groups(i32 1)
77+
call void @__mux_set_max_sub_group_size(i32 2)
78+
ret void
79+
}
80+
7081
declare i32 @__mux_get_sub_group_id()
7182
declare i32 @__mux_get_sub_group_local_id()
7283
declare i32 @__mux_sub_group_shuffle_i32(i32, i32)
7384
declare i32 @__mux_get_max_sub_group_size()
85+
86+
declare void @__mux_set_sub_group_id(i32)
87+
declare void @__mux_set_num_sub_groups(i32)
88+
declare void @__mux_set_max_sub_group_size(i32)

modules/compiler/utils/include/compiler/utils/sub_group_analysis.h

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ namespace utils {
3434
/// processed. Thus an external function declaration that uses sub-group
3535
/// builtins will be missed.
3636
///
37+
/// Internal mux sub-group 'setter' functions are not counted. This is because
38+
/// they only used internally by the oneAPI Construction Kit as scaffolding for
39+
/// the sub-group support that the user can observe.
40+
///
3741
/// Each function contains the set of mux sub-group builtins it (transitively)
3842
/// calls.
3943
class GlobalSubgroupInfo {

0 commit comments

Comments
 (0)