Skip to content

[AMDGPU] Fix: replace literal 0 with get_constant(0) in CreateSub#771

Merged
hughperkins merged 1 commit into
Genesis-Embodied-AI:mainfrom
AMD-Ecosystem:fix/amdgpu-clang-tidy-createSub
Jul 13, 2026
Merged

[AMDGPU] Fix: replace literal 0 with get_constant(0) in CreateSub#771
hughperkins merged 1 commit into
Genesis-Embodied-AI:mainfrom
AMD-Ecosystem:fix/amdgpu-clang-tidy-createSub

Conversation

@paveltc

@paveltc paveltc commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace the literal 0 argument in builder->CreateSub(0, input) with
tlctx->get_constant(0) in codegen_amdgpu.cpp.
The literal form triggers a clang-tidy modernize-use-nullptr false
positive (given CreateSub's Value* signature), and the explicit i32
constant is more idiomatic — matching the pattern used at multiple other
call sites in the same file.
No functional change. Verified with a full not slow test suite run on
AMD MI300X: 4167 passed, 0 failed.
Ported from AMD-Ecosystem#32.

quadrants/codegen/amdgpu/codegen_amdgpu.cpp: replace the literal `0`
   in builder->CreateSub(0, input) with tlctx->get_constant(0). The old
   form tripped modernize-use-nullptr (false positive given CreateSub's
   Value* signature), and the explicit i32 constant is also more
   idiomatic — matches the pattern at lines 255, 265, 395, 449 of the
   same file.
@paveltc paveltc changed the title fix(amdgpu): replace literal 0 with get_constant(0) in CreateSub [AMDGPU] Fix: replace literal 0 with get_constant(0) in CreateSub Jul 9, 2026
@hughperkins

Copy link
Copy Markdown
Collaborator
  • change looks reasonable to me
  • codex review passed
  • will approve once CI checks pass

@hughperkins hughperkins added the awaiting-ci-to-pass awaiting-ci-to-pass label Jul 13, 2026
@hughperkins

Copy link
Copy Markdown
Collaborator

CI failures you can ignore, for this PR:

  • 'api_docs | deploy'
  • 'Start AMD gpu runner'
  • 'Linux / coverage-comment'
  • check test coverage for changes
  • check line wrapping
  • check feature factorization
  • check deleted comments
  • PR change report

@hughperkins

Copy link
Copy Markdown
Collaborator

(so the CI is passing)

@hughperkins hughperkins removed the awaiting-ci-to-pass awaiting-ci-to-pass label Jul 13, 2026

@hughperkins hughperkins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@hughperkins

Copy link
Copy Markdown
Collaborator

oh, api_docs | deploy is 'required' 🤔

@hughperkins
hughperkins merged commit 38fa71f into Genesis-Embodied-AI:main Jul 13, 2026
48 of 56 checks passed
@hughperkins

Copy link
Copy Markdown
Collaborator

Thanks!

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.

3 participants