Skip to content

Add patched LLVM extensions build toggle#904

Open
mouliangyu wants to merge 2 commits into
hw-native-sys:mainfrom
mouliangyu:codex/patched-llvm-extensions-toggle
Open

Add patched LLVM extensions build toggle#904
mouliangyu wants to merge 2 commits into
hw-native-sys:mainfrom
mouliangyu:codex/patched-llvm-extensions-toggle

Conversation

@mouliangyu

Copy link
Copy Markdown
Contributor

Summary

  • add PTOAS_ENABLE_PATCHED_LLVM_EXTENSIONS CMake option, defaulting to ON
  • guard patch-only LLVM/MLIR extension references behind the option
  • allow clean upstream LLVM 21 builds to compile with -DPTOAS_ENABLE_PATCHED_LLVM_EXTENSIONS=OFF

Validation

  • cmake -S . -B .work/ptoas-build-llvm21-unpatched -DPTOAS_ENABLE_PATCHED_LLVM_EXTENSIONS=OFF
  • cmake --build .work/ptoas-build-llvm21-unpatched -j$(nproc)
  • .work/ptoas-build-llvm21-unpatched/tools/ptoas/ptoas --version

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new CMake option, PTOAS_ENABLE_PATCHED_LLVM_EXTENSIONS, which allows building code paths that depend on patched LLVM APIs. It wraps several LLVM-specific extensions, such as low-precision float types and SIMT calling conventions, in preprocessor guards across VPTOCANN900LLVMEmitter.cpp, VPTOLLVMEmitter.cpp, and VPTOLLVMEmitterHelper.cpp to ensure compatibility when these extensions are disabled. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@mouliangyu mouliangyu marked this pull request as ready for review July 7, 2026 06:30
@reedhecre

reedhecre commented Jul 7, 2026

Copy link
Copy Markdown

Codex Review

该评论由 review 机器人自动更新。

  • PR: Add patched LLVM extensions build toggle #904 Add patched LLVM extensions build toggle
  • Author: mouliangyu
  • Base/Head: main / codex/patched-llvm-extensions-toggle
  • Head SHA: 7397a13a1ae9
  • Trigger: PR 有新提交
  • Generated At: 2026-07-08T06:55:43Z
  • Previous Head SHA: 1b2461bf1c0b
  • Status: failed at codex-review (exit=1)

Summary

Review failed at stage codex-review: exit=1

Findings

未生成结构化 findings,因为 review 过程提前失败。

Log Tail

rm -rf '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/repo'
git clone --branch 'main' --depth 50 'https://github.com/hw-native-sys/PTOAS.git' '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/repo'
cd '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/repo'
git fetch origin 'refs/pull/904/head:pr-904' --depth 50
git fetch origin 'main' --depth 50 || true
git checkout -f 'pr-904'
git rev-parse HEAD
git diff --stat 'origin/main...HEAD' || true
Cloning into '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/repo'...
From https://github.com/hw-native-sys/PTOAS
 * [new ref]           refs/pull/904/head -> pr-904
From https://github.com/hw-native-sys/PTOAS
 * branch              main       -> FETCH_HEAD
Switched to branch 'pr-904'
7397a13a1ae9a043f50cdf4c35bc2e7c882419f4
 .github/workflows/native_llvm21.yml           | 156 ++++++++++++++++++++++++++
 CMakeLists.txt                                |   8 ++
 lib/PTO/Transforms/VPTOCANN900LLVMEmitter.cpp |  14 +++
 lib/PTO/Transforms/VPTOLLVMEmitter.cpp        |  14 +++
 lib/PTO/Transforms/VPTOLLVMEmitterHelper.cpp  |   8 ++
 5 files changed, 200 insertions(+)
===== END STAGE clone rc=0 @ 2026-07-08 14:55:35 =====

===== STAGE codex-review @ 2026-07-08 14:55:35 =====
set -euo pipefail
cd '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/repo'
'codex' exec -C '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/repo' -s read-only -c 'model_provider="codereview"' -c 'model="gpt-5.4"' -c 'model_reasoning_effort="xhigh"' --output-schema '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/review_schema.json' -o '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/codex_last_message.json' --color never - < '/tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/review_prompt.txt'
[monitor] stage timeout: 1800s
OpenAI Codex v0.115.0 (research preview)
--------
workdir: /tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/repo
model: gpt-5.4
provider: codereview
approval: never
sandbox: read-only
reasoning effort: xhigh
reasoning summaries: none
session id: 019f4082-b836-73a3-99ad-192cfebf3383
--------
user
你现在在审查 GitHub PR。

仓库:hw-native-sys/PTOAS
PR:#904 Add patched LLVM extensions build toggle
作者:mouliangyu
base branch:origin/main
head branch:HEAD(当前已 checkout 到 PR head)

要求:
1. 只审查这个 PR 相对 origin/main 的改动,必要时可以看上下文文件。
2. 重点找真实的 correctness / regression / contract mismatch / CI / runtime / compatibility 问题。
3. 不要提纯风格建议,不要提低价值猜测。
4. 严格按优先级输出:
   - P1:高概率会导致错误结果、编译/运行失败、严重回归、发布阻断
   - P2:重要缺陷、行为回归、遗漏校验/测试、较大兼容性问题
   - P3:次要但明确可改的问题
5. 如果没有问题,summary 直接写:未检查到 PR #904 存在问题,并返回 findings=[]。
6. 如果有问题,summary 简洁概括,findings 里每条都要给出:
   - severity
   - title
   - body(说明为什么是问题,尽量具体)
   - file(尽量给相对路径)
   - line(能确定就填整数,否则 null)

建议先查看:
- git status --short
- git diff --stat origin/main...HEAD
- git diff --unified=80 origin/main...HEAD

最终输出必须严格匹配 JSON schema。

mcp startup: no servers
Reconnecting... 1/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a17d2f2e4d7e4cbb-LAX, request id: 481eddcd-34f0-417a-8904-61fb68fab440)
Reconnecting... 2/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a17d2f317ca12f7b-LAX, request id: b27929aa-13b4-4e08-979f-7db38bf37990)
Reconnecting... 3/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a17d2f359a2017c8-LAX, request id: 5c635250-a866-4685-bfb2-0e7ea93b23f8)
Reconnecting... 4/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a17d2f3bfa159d07-LAS, request id: e9de0bd8-33f5-4af5-8790-18148e959a92)
Reconnecting... 5/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a17d2f46bc38f1aa-LAS, request id: f1c3bb40-5394-43f1-aada-a9e414ffc1e4)
ERROR: unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a17d2f5a7f9d5f10-LAS, request id: 83107324-e098-4ba0-b58d-e545f2ddb0dd
Warning: no last agent message; wrote empty content to /tmp/ptoas-pr-review-monitor/runs/20260708_145528_pr904/codex_last_message.json
===== END STAGE codex-review rc=1 @ 2026-07-08 14:55:43 =====

@mouliangyu mouliangyu force-pushed the codex/patched-llvm-extensions-toggle branch from ddb8f51 to 1b2461b Compare July 8, 2026 01:40
@mouliangyu mouliangyu force-pushed the codex/patched-llvm-extensions-toggle branch from 1b2461b to 7397a13 Compare July 8, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants