[all-commits] [llvm/llvm-project] dfb9bf: let a user select preferred/unpreferred capabiliti...
Vyacheslav Levytskyy via All-commits
all-commits at lists.llvm.org
Thu Feb 15 02:29:10 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: dfb9bf35c42a04a8f152dabf0a9d1a52e451f942
https://github.com/llvm/llvm-project/commit/dfb9bf35c42a04a8f152dabf0a9d1a52e451f942
Author: Vyacheslav Levytskyy <89994100+VyacheslavLevytskyy at users.noreply.github.com>
Date: 2024-02-15 (Thu, 15 Feb 2024)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
M llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h
M llvm/test/CodeGen/SPIRV/transcoding/spec_const.ll
Log Message:
-----------
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.
More information about the All-commits
mailing list