Skip to content

[Codegen] Fix uninitialized tensorCoreType causing flaky vector_to_gpu tests.#23701

Merged
benvanik merged 1 commit intomainfrom
users/benvanik/codegen-flake
Mar 9, 2026
Merged

[Codegen] Fix uninitialized tensorCoreType causing flaky vector_to_gpu tests.#23701
benvanik merged 1 commit intomainfrom
users/benvanik/codegen-flake

Conversation

@benvanik
Copy link
Copy Markdown
Collaborator

@benvanik benvanik commented Mar 9, 2026

Both LLVMGPUVectorToGPUPass and LLVMGPUTensorCoreVectorizationPass had an uninitialized GPUTensorCoreType member. When constructed via the inherited TableGen base class constructor (pipeline string invocation), the member was never set — reading it was undefined behavior. When stack garbage happened to equal MMA_SYNC (1), the passes took a wrong code path (e.g. running populateFoldMemRefAliasOpPatterns which folded subviews back into transfer_reads), producing IR that didn't match CHECK lines.

Initialize both to WMMA, matching the existing explicit constructor default.

…u tests.

Both LLVMGPUVectorToGPUPass and LLVMGPUTensorCoreVectorizationPass had
an uninitialized GPUTensorCoreType member. When constructed via the
inherited TableGen base class constructor (pipeline string invocation),
the member was never set — reading it was undefined behavior. When stack
garbage happened to equal MMA_SYNC (1), the passes took a wrong code
path (e.g. running populateFoldMemRefAliasOpPatterns which folded
subviews back into transfer_reads), producing IR that didn't match
CHECK lines.

Initialize both to WMMA, matching the existing explicit constructor
default.

Co-Authored-By: Claude <noreply@anthropic.com>
@benvanik benvanik added bug 🐞 Something isn't working codegen Shared code generation infrastructure and dialects labels Mar 9, 2026
@benvanik benvanik enabled auto-merge (squash) March 9, 2026 07:56
@benvanik benvanik merged commit e9ae43d into main Mar 9, 2026
61 checks passed
@benvanik benvanik deleted the users/benvanik/codegen-flake branch March 9, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working codegen Shared code generation infrastructure and dialects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants