Skip to content

Conversation

@zluda-violet
Copy link
Collaborator

For example,

.reg .u32 a, b;

For example,

```
.reg .u32 a, b;
```
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for parsing lists of variables in PTX declarations, enabling syntax like .reg .u32 a, b; where multiple variables of the same type and state space can be declared in a single statement.

Key changes:

  • Refactored Variable struct to separate type/space information from name into VariableInfo
  • Modified MultiVariable from struct to enum to handle both parameterized variables and comma-separated name lists
  • Updated parser to handle comma-separated variable names in declarations

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ptx_parser/src/ast.rs Restructured Variable and MultiVariable types to support multiple names
ptx_parser/src/lib.rs Updated parser logic to handle comma-separated variable names and restructured data
ptx/src/test/spirv_run/reg_multi.ptx Added test case demonstrating multi-variable declaration syntax
ptx/src/test/spirv_run/mod.rs Added test case for reg_multi functionality
ptx/src/test/ll/reg_multi.ll Expected LLVM output for reg_multi test
ptx/src/pass/*.rs Updated all passes to use new Variable/VariableInfo structure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Owner

@vosen vosen left a comment

Choose a reason for hiding this comment

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

Looks good, minor nit

@vosen vosen merged commit 875ac13 into vosen:master Sep 19, 2025
6 checks passed
@zluda-violet zluda-violet deleted the var-list branch September 19, 2025 21:00
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