[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69976BPZSY7W3H87Q5ER5R1":3,"skill-same:01M69976BPZSY7W3H87Q5ER5R1":95},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":50,"linkOnly":51,"markdownContent":52,"markdownBody":53,"frontMatter":54,"refName":55,"commitSha":56,"skillDirectory":57,"forksCount":58,"repositoryHtmlUrl":59,"repositoryHomepageUrl":60,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M69976BPZSY7W3H87Q5ER5R1","dump-intermediate-ir","编译器中间 IR 转储","Augments a `bazel run` CLI command for `heir-opt` with additional flags that dump the IR before each compiler pass, allowing the agent to inspect intermediate IR during compilation, identify a particular pass at which the pipeline fails, or extract the corresponding IR input to a particular pass for further debugging.","为 `heir-opt` 的 `bazel run` CLI 命令添加额外标志，在每个编译器 pass 之前转储 IR，使智能体能够检查编译过程中的中间 IR、定位流水线失败的特定 pass，或提取某个 pass 对应的 IR 输入以进一步调试。","google\u002Fheir","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M69973GM7GX7K1C2GYBW099F",948,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fheir\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdump_intermediate_ir\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRSRYQ3M8N5063NNQPF2B1","调试与故障排查","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"dump intermediate ir","intermediate","dump","opt","cli","for","at","inspect","which","with","input","flags","extract","command","pipeline","bazel","compiler","run","debugging","2026-11-10 10:12:30",false,"---\nname: dump-intermediate-ir\ndescription: >-\n  Augments a `bazel run` CLI command for `heir-opt` with additional flags\n  that dump the IR before each compiler pass, allowing the agent to inspect\n  intermediate IR during compilation, identify a particular pass at which the\n  pipeline fails, or extract the corresponding IR input to a particular pass\n  for further debugging.\n---\n\n# Dump intermediate IR during compilation\n\n## Overview\n\nThis skill guides the agent in adding flags to the `heir-opt` tool to dump the\ncompiled IR after each compiler pass to a series of files. These files can then\nbe inspected to identify the failing pass as well as the IR input to the failing\npass.\n\n## Usage\n\n### Converting a `bazel run` command\n\nTo convert a `bazel run` command, add the flags `--mlir-print-ir-before-all` and\n`--mlir-print-ir-tree-dir=\u003CPATH>`, where `\u003CPATH>` is a path to a temporary\ndirectory.\n\nFor example, given the following input command (which can be produced by the\n`lit-to-bazel` skill),\n\n```bash\nbazel run \u002F\u002Ftools:heir-opt -- --mlir-to-ckks='ciphertext-degree=8' --scheme-to-openfhe='entry-function=dot_product' \u002Fpath\u002Fto\u002Ffile\n```\n\nThe agent should produce the following (again where `\u003CPATH>` is chosen\nappropriately)\n\n```bash\nbazel run \u002F\u002Ftools:heir-opt -- --mlir-to-ckks='ciphertext-degree=8' --scheme-to-openfhe='entry-function=dot_product' --mlir-print-ir-before-all --mlir-print-ir-tree-dir=\u003CPATH> \u002Fpath\u002Fto\u002Ffile\n```\n\n### Tree structure\n\n`--mlir-print-ir-tree-dir` nests the dumped IR in a tree structure that matches\nthe nesting structure of the pass pipeline. In particular, by default all passes\nwill be nested under a `builtin_module_no-symbol-name\u002F` folder, and any passes\nin the pipeline that are anchored on nested operations like `func.func` will be\nplaced in subdirectories based on the name, such as\n`func_func_matvec__decrypt__result0` for a pass anchored on `func.func` when the\nIR contains a function called `matvec__decrypt__result0`.\n\nFor example, if the flag `--mlir-print-ir-tree-dir=\u002Ftmp\u002Fmlir` is used, then the\ndumped files might look like:\n\n```\n\u002Ftmp\u002Fmlir\u002F\n└── builtin_module_no-symbol-name\n    ├── 0_annotate-module.mlir\n    ├── 10_compare-to-sign-rewrite.mlir\n    ├── 11_canonicalize.mlir\n    ├── 12_cse.mlir\n    ├── 13_apply-folders.mlir\n    ├── 14_canonicalize.mlir\n    ├── 15_insert-rotate.mlir\n    ├── 16_cse.mlir\n    ├── 17_canonicalize.mlir\n    ├── 18_cse.mlir\n    ├── 19_collapse-insertion-chains.mlir\n    ├── 1_debug-validate-names.mlir\n    ├── 20_sccp.mlir\n    ├── 21_canonicalize.mlir\n    ...\n    ├── func_func__assign_layout_9911323688340753831\n    │   ├── 47_0_affine-expand-index-ops.mlir\n    │   ├── 47_1_affine-simplify-structures.mlir\n    │   ├── 47_2_affine-loop-normalize.mlir\n    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir\n    ├── func_func_matvec\n    │   ├── 47_0_affine-expand-index-ops.mlir\n    │   ├── 47_1_affine-simplify-structures.mlir\n    │   ├── 47_2_affine-loop-normalize.mlir\n    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir\n    ├── func_func_matvec__decrypt__result0\n    │   ├── 47_0_affine-expand-index-ops.mlir\n    │   ├── 47_1_affine-simplify-structures.mlir\n    │   ├── 47_2_affine-loop-normalize.mlir\n    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir\n    └── func_func_matvec__encrypt__arg0\n        ├── 47_0_affine-expand-index-ops.mlir\n        ├── 47_1_affine-simplify-structures.mlir\n        ├── 47_2_affine-loop-normalize.mlir\n        └── 47_3_forward-insert-slice-to-extract-slice.mlir\n```\n\n### Dumped file contents\n\nAt the top of each file, a comment is printed indicating how the file was\ngenerated, containing e.g., `IR Dump Before CSEPass (cse)`. This will say\nwhether the IR was dumped before or after a pass, as well as whether (in the\ncase of `--mlir-print-ir-after-failure`) the pass failed.\n\nBelow the comment, the MLIR is printed in textual format.\n\n## Gotchas\n\n- **Stale files**: `--mlir-print-ir-tree-dir` does not delete existing files, so\n  if the command is re-run, be sure to remove the existing temporary files\n  first.\n- **Dump before vs after**: `--mlir-print-ir-before-all` prints the IR before a\n  pass runs, which is required to extract the IR if a pass has a hard error like\n  a segfault. To dump the IR *after* each pass, use `--mlir-print-ir-after-all`.\n- **Dumping after failure**: For some errors without stack traces (like a\n  dialect conversion failure where the compiler fails gracefully), you can use\n  `--mlir-print-ir-after-failure` to dump the IR at failure time, which can\n  provide additional debugging information. One notable example is when dialect\n  conversion fails, the IR dumped by `--mlir-print-ir-after-failure` includes\n  the partially-converted IR including any `unrealized_conversion_cast` ops that\n  failed to be removed.\n- **Dumping after change**: The number of files can be reduced by using\n  `--mlir-print-ir-after-change`, which only prints the IR if the compiler pass\n  changed it. There is no \"before change\" analogue.\n- **Dumping after change**: The number of files can be reduced by using\n  `--mlir-print-ir-before=\u003Cpass_name>`, which only prints the IR before the\n  target pass. Since a pass can be run multiple times in a pipeline, this may\n  still produce many files if, for example, the pass is a common one like `cse`.\n\n```markdown\nCopy this checklist and track progress:\n\n- [ ] Step 1: Identify the command to convert, perhaps with `lit-to-bazel`\n- [ ] Step 2: Add the relevant flags, defaulting to `--mlir-print-ir-before-all` and `--mlir-print-ir-tree-dir` if there is no specific reason to use the more specific flags.\n- [ ] Step 3: Inspect the generated command and run it.\n- [ ] Step 4: Inspect the dumped files for information.\n```\n\n\u003C!-- mdformat global-off -->\n","# Dump intermediate IR during compilation\n\n## Overview\n\nThis skill guides the agent in adding flags to the `heir-opt` tool to dump the\ncompiled IR after each compiler pass to a series of files. These files can then\nbe inspected to identify the failing pass as well as the IR input to the failing\npass.\n\n## Usage\n\n### Converting a `bazel run` command\n\nTo convert a `bazel run` command, add the flags `--mlir-print-ir-before-all` and\n`--mlir-print-ir-tree-dir=\u003CPATH>`, where `\u003CPATH>` is a path to a temporary\ndirectory.\n\nFor example, given the following input command (which can be produced by the\n`lit-to-bazel` skill),\n\n```bash\nbazel run \u002F\u002Ftools:heir-opt -- --mlir-to-ckks='ciphertext-degree=8' --scheme-to-openfhe='entry-function=dot_product' \u002Fpath\u002Fto\u002Ffile\n```\n\nThe agent should produce the following (again where `\u003CPATH>` is chosen\nappropriately)\n\n```bash\nbazel run \u002F\u002Ftools:heir-opt -- --mlir-to-ckks='ciphertext-degree=8' --scheme-to-openfhe='entry-function=dot_product' --mlir-print-ir-before-all --mlir-print-ir-tree-dir=\u003CPATH> \u002Fpath\u002Fto\u002Ffile\n```\n\n### Tree structure\n\n`--mlir-print-ir-tree-dir` nests the dumped IR in a tree structure that matches\nthe nesting structure of the pass pipeline. In particular, by default all passes\nwill be nested under a `builtin_module_no-symbol-name\u002F` folder, and any passes\nin the pipeline that are anchored on nested operations like `func.func` will be\nplaced in subdirectories based on the name, such as\n`func_func_matvec__decrypt__result0` for a pass anchored on `func.func` when the\nIR contains a function called `matvec__decrypt__result0`.\n\nFor example, if the flag `--mlir-print-ir-tree-dir=\u002Ftmp\u002Fmlir` is used, then the\ndumped files might look like:\n\n```\n\u002Ftmp\u002Fmlir\u002F\n└── builtin_module_no-symbol-name\n    ├── 0_annotate-module.mlir\n    ├── 10_compare-to-sign-rewrite.mlir\n    ├── 11_canonicalize.mlir\n    ├── 12_cse.mlir\n    ├── 13_apply-folders.mlir\n    ├── 14_canonicalize.mlir\n    ├── 15_insert-rotate.mlir\n    ├── 16_cse.mlir\n    ├── 17_canonicalize.mlir\n    ├── 18_cse.mlir\n    ├── 19_collapse-insertion-chains.mlir\n    ├── 1_debug-validate-names.mlir\n    ├── 20_sccp.mlir\n    ├── 21_canonicalize.mlir\n    ...\n    ├── func_func__assign_layout_9911323688340753831\n    │   ├── 47_0_affine-expand-index-ops.mlir\n    │   ├── 47_1_affine-simplify-structures.mlir\n    │   ├── 47_2_affine-loop-normalize.mlir\n    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir\n    ├── func_func_matvec\n    │   ├── 47_0_affine-expand-index-ops.mlir\n    │   ├── 47_1_affine-simplify-structures.mlir\n    │   ├── 47_2_affine-loop-normalize.mlir\n    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir\n    ├── func_func_matvec__decrypt__result0\n    │   ├── 47_0_affine-expand-index-ops.mlir\n    │   ├── 47_1_affine-simplify-structures.mlir\n    │   ├── 47_2_affine-loop-normalize.mlir\n    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir\n    └── func_func_matvec__encrypt__arg0\n        ├── 47_0_affine-expand-index-ops.mlir\n        ├── 47_1_affine-simplify-structures.mlir\n        ├── 47_2_affine-loop-normalize.mlir\n        └── 47_3_forward-insert-slice-to-extract-slice.mlir\n```\n\n### Dumped file contents\n\nAt the top of each file, a comment is printed indicating how the file was\ngenerated, containing e.g., `IR Dump Before CSEPass (cse)`. This will say\nwhether the IR was dumped before or after a pass, as well as whether (in the\ncase of `--mlir-print-ir-after-failure`) the pass failed.\n\nBelow the comment, the MLIR is printed in textual format.\n\n## Gotchas\n\n- **Stale files**: `--mlir-print-ir-tree-dir` does not delete existing files, so\n  if the command is re-run, be sure to remove the existing temporary files\n  first.\n- **Dump before vs after**: `--mlir-print-ir-before-all` prints the IR before a\n  pass runs, which is required to extract the IR if a pass has a hard error like\n  a segfault. To dump the IR *after* each pass, use `--mlir-print-ir-after-all`.\n- **Dumping after failure**: For some errors without stack traces (like a\n  dialect conversion failure where the compiler fails gracefully), you can use\n  `--mlir-print-ir-after-failure` to dump the IR at failure time, which can\n  provide additional debugging information. One notable example is when dialect\n  conversion fails, the IR dumped by `--mlir-print-ir-after-failure` includes\n  the partially-converted IR including any `unrealized_conversion_cast` ops that\n  failed to be removed.\n- **Dumping after change**: The number of files can be reduced by using\n  `--mlir-print-ir-after-change`, which only prints the IR if the compiler pass\n  changed it. There is no \"before change\" analogue.\n- **Dumping after change**: The number of files can be reduced by using\n  `--mlir-print-ir-before=\u003Cpass_name>`, which only prints the IR before the\n  target pass. Since a pass can be run multiple times in a pipeline, this may\n  still produce many files if, for example, the pass is a common one like `cse`.\n\n```markdown\nCopy this checklist and track progress:\n\n- [ ] Step 1: Identify the command to convert, perhaps with `lit-to-bazel`\n- [ ] Step 2: Add the relevant flags, defaulting to `--mlir-print-ir-before-all` and `--mlir-print-ir-tree-dir` if there is no specific reason to use the more specific flags.\n- [ ] Step 3: Inspect the generated command and run it.\n- [ ] Step 4: Inspect the dumped files for information.\n```\n\n\u003C!-- mdformat global-off -->\n",{"name":5,"description":7},"main","016c0b1e281a20df45b81c31ec893cf1198ff10b",".agents\u002Fskills\u002Fdump_intermediate_ir",185,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fheir","https:\u002F\u002Fheir.dev\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-15 00:27:48",{"source":9,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add google\u002Fheir --skill dump-intermediate-ir",{"tool":71,"command":72},"bunx","bunx skills add google\u002Fheir --skill dump-intermediate-ir",{"tool":74,"command":75},"pnpm","pnpm dlx skills add google\u002Fheir --skill dump-intermediate-ir","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fheir\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdump_intermediate_ir\u002FSKILL.md",true,[79,85,89],{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"config\u002Feslint.config.js","SCRIPT","脚本",4658,"https:\u002F\u002Fgithub.com\u002Fnejcm\u002Fulis\u002Fblob\u002Fmaster\u002Fexample\u002Fskills\u002Fcode-quality\u002Fconfig\u002Feslint.config.js",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"config\u002Fprettier.config.js",1273,"https:\u002F\u002Fgithub.com\u002Fnejcm\u002Fulis\u002Fblob\u002Fmaster\u002Fexample\u002Fskills\u002Fcode-quality\u002Fconfig\u002Fprettier.config.js",{"path":90,"resourceType":91,"resourceTypeDesc":92,"sizeBytes":93,"sourceHtmlUrl":94},"config\u002Ftsconfig.json","REFERENCE","参考文档",1985,"https:\u002F\u002Fgithub.com\u002Fnejcm\u002Fulis\u002Fblob\u002Fmaster\u002Fexample\u002Fskills\u002Fcode-quality\u002Fconfig\u002Ftsconfig.json",[96,115,140],{"skillNo":97,"name":98,"nameZh":99,"description":100,"descriptionZh":101,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":102,"categories":103,"keywords":106,"publishedAt":50},"01M6997B7NY7K5V08MMTMAE1ZS","reproduce-failure","编译失败复现","Describes a decision tree of steps and skills to utilize when, starting from a test failure or the failure of `bazel run` command using heir-opt, you would like to produce a reproducing input IR that fails on a particular compiler pass.","描述在面对测试失败或使用 heir-opt 执行 `bazel run` 命令失败时，应采用的步骤与技能决策树，用于生成能在特定编译器 Pass 上失败的复现输入 IR。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fheir\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Freproduce_failure\u002FSKILL.md",[104,105],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[107,108,109,48,110,47,46,111,44,41,112,113,114,34],"reproduce failure","reproduce","test","produce","decision","you","tree","when",{"skillNo":116,"name":117,"nameZh":118,"description":119,"descriptionZh":120,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":121,"categories":122,"keywords":127,"publishedAt":50},"01M69979ENN9XYV6AZACX1RK06","lit-to-bazel","MLIR lit 测试转 Bazel 命令","Converts MLIR lit test files to `bazel run` commands. Use when you need to convert a failing MLIR lit test target (containing RUN lines) to a shell command whose flags can be modified for further analysis and debugging.","将 MLIR lit 测试文件转换为 `bazel run` 命令。当需要将某个失败的 MLIR lit 测试目标（包含 RUN 行）转换为可修改标志的 shell 命令，以便进一步分析和调试时使用。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fheir\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Flit_to_bazel\u002FSKILL.md",[123,124],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":125,"categoryName":126,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[128,129,46,130,112,131,132,36,133,114,134,135,136,44,137,109,49,48,138,139],"lit","lit to bazel","commands","can","files","shell command","use","failing","shell","mlir","analysis","convert",{"skillNo":141,"name":142,"nameZh":143,"description":144,"descriptionZh":145,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":146,"categories":147,"keywords":150,"publishedAt":50},"01M699782STZMR7Y5YT8M2EM4Q","e2e-to-bazel","端到端测试转 Bazel 命令","Converts end-to-end (e2e) test targets or paths to `bazel run` commands for `heir-opt`. Use when you need to convert an e2e test target (where flags are defined in the BUILD file) to a shell command whose flags can be modified for further analysis and debugging.","将端到端（e2e）测试目标或路径转换为用于 `heir-opt` 的 `bazel run` 命令。当需要将某个 e2e 测试目标（其标志在 BUILD 文件中定义）转换为可修改标志的 shell 命令，以便进一步分析和调试时使用。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fheir\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fe2e_to_bazel\u002FSKILL.md",[148,149],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":125,"categoryName":126,"taxonomyType":28,"taxonomyTypeDesc":29},[151,46,152,112,109,49,153,138,139,44,134,154,155,156,157,131,36,133,114,34],"e2e","e2e to bazel","file","e2e test","build","end","targets"]