[Mlir-commits] [mlir] [mlir][spirv] Extend capabilities and extensions requirements checking (PR #68031)
Md Abdullah Shahneous Bari
llvmlistbot at llvm.org
Thu Oct 12 08:49:50 PDT 2023
================
@@ -90,8 +98,55 @@ static LogicalResult checkCapabilityRequirements(
return success();
}
-/// Returns true if the given `storageClass` needs explicit layout when used in
-/// Shader environments.
+/// Check capabilities and extensions requirements
+/// Checks that `capCandidates`, `extCandidates`, and capability
+/// (`capCandidates`) infered extension requirements are possible to be
+/// satisfied with the given `targetEnv`.
+/// It also provides a way to relax requirements for certain capabilities and
+/// extensions (e.g., `elidedCapCandidates`, `elidedExtCandidates`), this is to
+/// allow passes to relax certain requirements based on an option (e.g.,
+/// relaxing bitwidth requirement, see `convertScalarType()`,
+/// `ConvertVectorType()`).
+template <typename LabelT>
+static LogicalResult checkCapabilityAndExtensionRequirements(
+ LabelT label, const spirv::TargetEnv &targetEnv,
+ const spirv::SPIRVType::CapabilityArrayRefVector &capCandidates,
+ const spirv::SPIRVType::ExtensionArrayRefVector &extCandidates,
+ const ArrayRef<spirv::Capability> elidedCapCandidates = {},
+ const ArrayRef<spirv::Extension> elidedExtCandidates = {}) {
----------------
mshahneo wrote:
Sorry, this PR does not have a use of this functionality. The another PR has the use. (staged PR issue :( )
[https://github.com/llvm/llvm-project/pull/68033/commits/8fb67d073975bc09d78641fb9c2f47a385f47030#diff-c6b3a362d1ea775a83e42bc1c61b34698d4a418e081e80ba8031768bcf81e309R425](url)
https://github.com/llvm/llvm-project/pull/68031
More information about the Mlir-commits
mailing list