Skip to content

Commit

Permalink
Merge pull request #131 from frasercrmck/sub-group-analysis-clarify
Browse files Browse the repository at this point in the history
[compiler] Clarify semantics of SubgroupAnalysis pass
  • Loading branch information
frasercrmck authored Sep 18, 2023
2 parents b7bb746 + 7c656e1 commit 7b6eeaf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/compiler/test/lit/passes/sub-group-analysis.ll
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,22 @@ exit:
ret void
}

; We don't consider any of the internal mux 'setters' as uses of sub-group
; builtins, as they are purely there to support the framework and aren't
; apparent to the user.
; CHECK: Function 'function4' uses no sub-group builtins
define spir_func void @function4() {
call void @__mux_set_sub_group_id(i32 0)
call void @__mux_set_num_sub_groups(i32 1)
call void @__mux_set_max_sub_group_size(i32 2)
ret void
}

declare i32 @__mux_get_sub_group_id()
declare i32 @__mux_get_sub_group_local_id()
declare i32 @__mux_sub_group_shuffle_i32(i32, i32)
declare i32 @__mux_get_max_sub_group_size()

declare void @__mux_set_sub_group_id(i32)
declare void @__mux_set_num_sub_groups(i32)
declare void @__mux_set_max_sub_group_size(i32)
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ namespace utils {
/// processed. Thus an external function declaration that uses sub-group
/// builtins will be missed.
///
/// Internal mux sub-group 'setter' functions are not counted. This is because
/// they only used internally by the oneAPI Construction Kit as scaffolding for
/// the sub-group support that the user can observe.
///
/// Each function contains the set of mux sub-group builtins it (transitively)
/// calls.
class GlobalSubgroupInfo {
Expand Down

0 comments on commit 7b6eeaf

Please sign in to comment.