NVIDIA / NVIDIA/cuda-quantum

[Python] All the variables should be inserted at the top of the entry block

Open
#1,963 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

python bridge stale-notified
Dominant language
C++
Stars
1.1k
Forks
456
Avg merge
1d 22h
Merged PRs (30d)
165

Description

All the variables should be inserted at the top of the entry block, so this alloca, store, alloca pattern would ought to look like alloca, alloca, store, ...

Originally posted by @schweitzpgi in https://github.com/NVIDIA/cuda-quantum/pull/1952#discussion_r1683007179

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Python entry-block handling that inserts variables and inspect how alloca and store operations are emitted. The change is done when variables produce consecutive alloca operations at the top of the entry block, before their stores; no file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.