forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sycl-post-link] Don't split module if function pointer has a user th…
…at's not CallInst (intel#4657)
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
llvm/test/tools/sycl-post-link/auto-module-split-func-ptr.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
; RUN: sycl-post-link -split=auto -symbols -S %s -o %t.table | ||
; RUN: FileCheck %s -input-file=%t_0.sym | ||
|
||
; This test checkes that module is not split if function pointer's user is not | ||
; CallInst. | ||
|
||
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" | ||
target triple = "spir64_x86_64-unknown-unknown" | ||
|
||
@_Z2f1iTable = weak global [1 x i32 (i32)*] [i32 (i32)* @_Z2f1i], align 8 | ||
|
||
; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn | ||
define dso_local spir_func i32 @_Z2f1i(i32 %a) #0 { | ||
entry: | ||
ret i32 %a | ||
} | ||
|
||
; Function Attrs: convergent norecurse | ||
define weak_odr dso_local spir_kernel void @kernel1() #1 { | ||
entry: | ||
%0 = call i32 @indirect_call(i32 (i32)* addrspace(4)* addrspacecast (i32 (i32)** getelementptr inbounds ([1 x i32 (i32)*], [1 x i32 (i32)*]* @_Z2f1iTable, i64 0, i64 0) to i32 (i32)* addrspace(4)*), i32 0) | ||
ret void | ||
} | ||
|
||
; Function Attrs: convergent norecurse | ||
define dso_local spir_kernel void @kernel2() #2 { | ||
entry: | ||
ret void | ||
} | ||
|
||
declare dso_local spir_func i32 @indirect_call(i32 (i32)* addrspace(4)*, i32) local_unnamed_addr | ||
|
||
attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn } | ||
attributes #1 = { convergent norecurse "sycl-module-id"="TU1.cpp" } | ||
attributes #2 = { convergent norecurse "sycl-module-id"="TU2.cpp" } | ||
|
||
; CHECK: kernel1 | ||
; CHECK: kernel2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters