
A new test added for spirv-friendly builtins for SPV_KHR_bit_instructions unveiled that current mechanism to detect whether SPIRV Backend is in OpenCL environment or Vulkan environment was not good enough. This PR updates how to detect the environment and all the tests accordingly. *UPDATE*: the new approach is having a new member in `SPIRVSubtarget` to represent the environment. It can be either OpenCL, Kernel or Unknown. If the triple is explicit, we can directly set it at the creation of the `SPIRVSubtarget`, otherwise we just leave it unknown until we find other information that can help us set the environment. For now, the only other information we use to set the environment is `hlsl.shader` attribute at `SPIRV::ExecutionModel::ExecutionModel getExecutionModel(const SPIRVSubtarget &STI, const Function &F)`. Going forward we should consider also specific instructions that are Kernel-exclusive or Shader-exclusive. --------- Co-authored-by: marcos.maronas <mmaronas@smtp.igk.intel.com>
11 lines
411 B
LLVM
11 lines
411 B
LLVM
; RUN: llc -O0 -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s
|
|
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %}
|
|
|
|
;; Ensure the required Capabilities are listed.
|
|
; CHECK-DAG: OpCapability Shader
|
|
; CHECK-DAG: OpCapability Linkage
|
|
|
|
;; Ensure one, and only one, OpMemoryModel is defined.
|
|
; CHECK: OpMemoryModel Logical GLSL450
|
|
; CHECK-NOT: OpMemoryModel
|