Skip to content

Conversation

xlauko
Copy link
Contributor

@xlauko xlauko commented Oct 6, 2025

No description provided.

@xlauko xlauko marked this pull request as ready for review October 6, 2025 19:27
@xlauko
Copy link
Contributor Author

xlauko commented Oct 6, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Oct 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 6, 2025

@llvm/pr-subscribers-clangir

@llvm/pr-subscribers-clang

Author: Henrich Lauko (xlauko)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/162142.diff

1 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/IR/CIROps.td (+5-5)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index d4ffcf3a75f50..addc37857bfcd 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -278,22 +278,22 @@ def CIR_PtrStrideOp : CIR_Op<"ptr_stride", [
 def CIR_ConstantOp : CIR_Op<"const", [
   ConstantLike, Pure, AllTypesMatch<["value", "res"]>
 ]> {
-  let summary = "Defines a CIR constant";
+  let summary = "Create a CIR constant from a literal attribute";
   let description = [{
     The `cir.const` operation turns a literal into an SSA value. The data is
     attached to the operation as an attribute.
 
     ```mlir
-      %0 = cir.const 42 : i32
-      %1 = cir.const 4.2 : f32
-      %2 = cir.const nullptr : !cir.ptr<i32>
+      %0 = cir.const #cir.int<4> : !u32i
+      %1 = cir.const #cir.fp<1.500000e+00> : !cir.float
+      %2 = cir.const #cir.ptr<null> : !cir.ptr<!void>
     ```
   }];
 
   let arguments = (ins TypedAttrInterface:$value);
   let results = (outs CIR_AnyType:$res);
 
-  let assemblyFormat = "attr-dict $value";
+  let assemblyFormat = "$value attr-dict";
 
   let hasVerifier = 1;
 

Base automatically changed from users/xlauko/cir-ptr-stride-assembly-format to main October 6, 2025 19:58
@xlauko xlauko force-pushed the users/xlauko/cir-constant-op-assembly-format branch from 8f5d437 to a76ab83 Compare October 6, 2025 19:59
Copy link
Contributor

@andykaylor andykaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@xlauko
Copy link
Contributor Author

xlauko commented Oct 7, 2025

Merge activity

  • Oct 7, 8:12 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 7, 8:13 AM UTC: @xlauko merged this pull request with Graphite.

@xlauko xlauko merged commit 1187740 into main Oct 7, 2025
9 checks passed
@xlauko xlauko deleted the users/xlauko/cir-constant-op-assembly-format branch October 7, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants