{"id":16397527,"url":"https://github.com/coord-e/oir","last_synced_at":"2025-11-14T02:01:44.943Z","repository":{"id":115892187,"uuid":"233994897","full_name":"coord-e/oir","owner":"coord-e","description":"oir: OtakuAssembly Vol.2 第一章『データフロー最適化の実装』サンプル実装","archived":false,"fork":false,"pushed_at":"2020-03-07T10:53:47.000Z","size":97,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-02-15T11:00:00.314Z","etag":null,"topics":["compiler-optimization","otakuassembly"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coord-e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-15T04:01:00.000Z","updated_at":"2023-05-09T06:22:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"f097b032-0f80-48d0-97cf-622a84c70e7d","html_url":"https://github.com/coord-e/oir","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Foir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Foir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Foir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Foir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coord-e","download_url":"https://codeload.github.com/coord-e/oir/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240286519,"owners_count":19777353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler-optimization","otakuassembly"],"created_at":"2024-10-11T05:10:20.120Z","updated_at":"2025-11-14T02:01:44.892Z","avatar_url":"https://github.com/coord-e.png","language":"C","readme":"# oir\n\n[![Actions Status](https://github.com/coord-e/oir/workflows/latest/badge.svg)](https://github.com/coord-e/oir/actions?workflow=latest)\n\nOtakuAssembly Vol.2 第一章『データフロー最適化の実装』サンプル実装\n\n| OtakuAssembly Vol.2 | OtakuAssembly Vol.2 電子版 |\n| :---: | :---: |\n| [![book](https://img.shields.io/badge/get%20it%20on-BOOTH-fc4e50)](https://otakuassembly.booth.pm/items/1834753) | [![ebook](https://img.shields.io/badge/get%20it%20on-BOOTH-fc4e50)](https://otakuassembly.booth.pm/items/1834745) |\n\n## 遊び方\n\n```\nusage: oir [options]\n\n    -i input_file           (default: \"-\")\n    -f input_format         (default: \"text\")\n    -o output_file          (default: \"-\")\n    -g output_format        (default: \"text\")\n    -p passes               (default: \"reach,prop,available,cse,live,dce\")\n    -l number_of_loops      (default: \"1\")\n    -h help                 (default: \"false\")\n```\n\n`oir`は入力のOIRに解析や最適化を施して出力するプログラムです。`-o`と`-i`でそれぞれ出力と入力ファイルを指定できます。指定しない場合は標準入出力がデフォルトで使われます。\n\n`-p`オプションで入力に施す解析や最適化とその順番をカンマ区切りで指定できます。さらに、`-l`オプションで`-p`で指定した手順を指定回数繰り返させることができます。\n\n`-g`オプションで出力の形式を指定できます。`-g text`がデフォルトの形式です。`-g json`で、解析結果を含めたOIRについてのほとんどの情報をJSON形式で出力します。`-g graph`では、[Graphviz](https://www.graphviz.org/)のdot形式でOIRのCFGを出力します。出力したdot形式のファイルは、`dot`コマンドでPDFや画像として見ることができます。\n\n例えば、`text/count.oir`にデッドコード削除を行った結果のOIRのCFGを`cfg.pdf`に出力するには、次のようにします:\n\n```shell\n$ ./build/oir -i text/count.oir -g graph -p live,dce -o cfg.gv\n$ dot -Tpdf -o cfg.pdf cfg.gv\n```\n\n## テスト\n\n```shell\n$ make test.docker\n```\n\n## 報告について\n\nOtakuAssembly Vol.2 第一章『データフロー最適化の実装』について、何か問題や誤植などを見つけた場合は当リポジトリのIssueにて対応いたします。正誤表はこのREADMEに掲載します。その他質問などございましたら、筆者[coord_e](https://twitter.com/coord_e)までお気軽にご連絡ください。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoord-e%2Foir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoord-e%2Foir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoord-e%2Foir/lists"}