[AMDGPU] Fix: replace literal 0 with get_constant(0) in CreateSub#771
Merged
hughperkins merged 1 commit intoJul 13, 2026
Conversation
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.
Collaborator
|
Collaborator
|
CI failures you can ignore, for this PR:
|
Collaborator
|
(so the CI is passing) |
Collaborator
|
oh, api_docs | deploy is 'required' 🤔 |
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the literal
0argument inbuilder->CreateSub(0, input)withtlctx->get_constant(0)incodegen_amdgpu.cpp.The literal form triggers a clang-tidy
modernize-use-nullptrfalsepositive (given
CreateSub'sValue*signature), and the explicit i32constant is more idiomatic — matching the pattern used at multiple other
call sites in the same file.
No functional change. Verified with a full
not slowtest suite run onAMD MI300X: 4167 passed, 0 failed.
Ported from AMD-Ecosystem#32.