Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/SYCLLowerIR/SYCLDeviceLibReqMask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ uint32_t getDeviceLibBits(const std::string &FuncName) {
// And we don't expect non-spirv functions with "__devicelib_" prefix.
uint32_t llvm::getSYCLDeviceLibReqMask(const Module &M) {
// Device libraries will be enabled only for spir-v module.
if (!Triple(M.getTargetTriple()).isSPIR())
if (!Triple(M.getTargetTriple()).isSPIROrSPIRV())
return 0;
uint32_t ReqMask = 0;
for (const Function &SF : M) {
Expand Down
20 changes: 20 additions & 0 deletions llvm/test/tools/sycl-post-link/device-requirements/mask.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; RUN: sycl-post-link -properties -split=auto < %s -o %t.files.table
; RUN: FileCheck %s -input-file=%t.files_0.prop

; CHECK:[SYCL/devicelib req mask]
; CHECK: DeviceLibReqMask=1|64

source_filename = "main.cpp"
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 = "spirv64-unknown-unknown"

declare spir_func i32 @__devicelib_imf_umulhi(i32 noundef %0, i32 noundef %1)

; Function Attrs: convergent mustprogress noinline norecurse optnone
define weak_odr dso_local spir_kernel void @kernel() #0 {
entry:
%0 = call i32 @__devicelib_imf_umulhi(i32 0, i32 0)
ret void
}

attributes #0 = { "sycl-module-id"="main.cpp" }