-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The magic numbers from the nextBaseAddress are incorrectly compared with
constant values. They are usually simplified as unequal values.
- Loading branch information
Oleksandr Demydenko
committed
Oct 3, 2024
1 parent
11ea6b5
commit 17c7305
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
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
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,17 @@ | ||
// RUN: clspv %target %s -o %t.spv --hack-logical-ptrtoint -cl-kernel-arg-info -spv-version=1.6 | ||
// RUN: spirv-dis %t.spv -o %t.spvasm | ||
// RUN: FileCheck %s < %t.spvasm | ||
// RUN: spirv-val --target-env vulkan1.3 %t.spv | ||
|
||
// CHECK: [[uint:%[a-zA-Z]+]] = OpTypeInt 32 0 | ||
// CHECK: [[uint0:%[a-zA-Z0-9_]+]] = OpConstant [[uint]] 0 | ||
// CHECK: [[nullptr:%[0-9]+]] = OpConstantNull %{{[a-zA-Z0-9_]+}} | ||
// CHECK: [[bool:%[a-zA-Z]+]] = OpTypeBool | ||
// CHECK: [[ptr:%[a-zA-Z0-9_]+]] = OpAccessChain %{{[a-zA-Z0-9_]+}} %{{[a-zA-Z0-9_]+}} [[uint0]] [[uint0]] | ||
// CHECK: [[cmp:%[a-zA-Z0-9_]+]] = OpPtrNotEqual [[bool]] [[ptr]] [[nullptr]] | ||
|
||
kernel void test_kernel(global float *src, global long *dst) | ||
{ | ||
uint tid = get_global_id(0); | ||
dst[tid] = (long)(src != 0); | ||
} |