aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorVyacheslav Levytskyy <89994100+VyacheslavLevytskyy@users.noreply.github.com>2024-02-15 11:28:58 +0100
committerGitHub <noreply@github.com>2024-02-15 11:28:58 +0100
commitdfb9bf35c42a04a8f152dabf0a9d1a52e451f942 (patch)
tree9b7dd4d49eb1620048fabef27300d19f0e99a26b /clang/lib/CodeGen/CodeGenModule.cpp
parent09b80e6145a2e619fa8ff486a04cdc7d1534a81a (diff)
downloadllvm-dfb9bf35c42a04a8f152dabf0a9d1a52e451f942.zip
llvm-dfb9bf35c42a04a8f152dabf0a9d1a52e451f942.tar.gz
llvm-dfb9bf35c42a04a8f152dabf0a9d1a52e451f942.tar.bz2
let a user select preferred/unpreferred capabilities in a list of enabling capabilities (#81476)
By SPIR-V specification: "If an instruction, enumerant, or other feature specifies multiple enabling capabilities, only one such capability needs to be declared to use the feature." However, one capability may be preferred over another. One important case is Shader capability that may not be supported by a backend, but always is inserted if "OpDecorate SpecId" is found, because Enabling Capabilities for the latter is the list of Shader and Kernel, where Shader is coming first and thus always selected as the first available option. In this PR we address the problem by keeping current behaviour of selecting the first option among enabling capabilities as is, but giving a user a way to filter capabilities during the selection process via a newly introduced "--avoid-spirv-capabilities" command line option. This option is to avoid selection of certain capabilities if there are other available enabling capabilities. This PR is changing also existing pruneCapabilities() function. It doesn't remove capability from module requirement anymore, but only adds implicitly required capabilities recursively, so its name is changed accordingly. This change fixes the present bug in collecting required by a module capabilities. Before the change, introduced by this PR, pruneCapabilities() function has been removing, for example, Kernel capability from required by a module, because Kernel is initially required and the second time it was needed pruneCapabilities() removed it by mistake.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions