[mlir][spirv] Remove ConstantLike trait from spirv.ARM.GraphConstant#198054
Merged
Conversation
Operations with the `ConstantLike` trait can always be folded into a concrete attribute value. However, the `spirv.ARM.GraphConstant` op cannot be folded, because its GraphConstantID is merely a unique identifier used to map to the actual constants defined in the SPIR-V module. Therefore, the `ConstantLike` trait should be removed from `pirv.ARM.GraphConstant`.
|
@llvm/pr-subscribers-mlir-spirv @llvm/pr-subscribers-mlir Author: Longsheng Mou (CoTinker) ChangesOperations with the Full diff: https://github.com/llvm/llvm-project/pull/198054.diff 1 Files Affected:
diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGraphOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGraphOps.td
index d8012749131d6..b68a635253975 100644
--- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGraphOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGraphOps.td
@@ -116,7 +116,7 @@ def InGraphScope : PredOpTrait<
// -----
-def SPIRV_GraphConstantARMOp : SPIRV_GraphARMOp<"GraphConstant", [InGraphScope, Pure, ConstantLike]> {
+def SPIRV_GraphConstantARMOp : SPIRV_GraphARMOp<"GraphConstant", [InGraphScope, Pure]> {
let summary = "Declare a graph constant.";
let description = [{
|
kuhar
approved these changes
May 16, 2026
davidegrohmann
approved these changes
May 16, 2026
pedroMVicente
pushed a commit
to pedroMVicente/llvm-project
that referenced
this pull request
May 19, 2026
…lvm#198054) Operations with the `ConstantLike` trait can always be folded into a concrete attribute value. However, the `spirv.ARM.GraphConstant` op cannot be folded, because its GraphConstantID is merely a unique identifier used to map to the actual constants defined in the SPIR-V module. Therefore, the `ConstantLike` trait should be removed from `pirv.ARM.GraphConstant`. Fixes llvm#197970.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Operations with the
ConstantLiketrait can always be folded into a concrete attribute value. However, thespirv.ARM.GraphConstantop cannot be folded, because its GraphConstantID is merely a unique identifier used to map to the actual constants defined in the SPIR-V module. Therefore, theConstantLiketrait should be removed frompirv.ARM.GraphConstant. Fixes #197970.