Skip to content

compiler: add structured LLVM coroutine builder - #12

Merged
cpunion merged 1 commit into
llvm-corofrom
coro/phase5-llvm-builder
Jul 15, 2026
Merged

compiler: add structured LLVM coroutine builder#12
cpunion merged 1 commit into
llvm-corofrom
coro/phase5-llvm-builder

Conversation

@cpunion

@cpunion cpunion commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a structured switched-resume coroutine builder with initial, ordinary, and final suspend control flow
  • inject frame allocation/free hooks while enforcing their append-only CFG contract
  • honor target-width frame size/alignment and LLVM 14/18/22 coroutine ABI boundaries
  • validate the real CoroSplit shape on LLVM 14, 18, 19, and 21 in focused CI

This slice only builds the selected coroutine primary. It does not add a synchronous twin, dynamic dispatch, scheduler policy, or a fixed runtime frame ABI. The binding-level switched-resume smoke coverage is merged in cpunion/llvm#3.

Testing

  • go test ./ssa -count=1
  • go test -race ./ssa -run ^'TestCoroBuilder' -count=1\n- go vet -copylocks=false ./ssa\n- go test -tags=llgo ./ssa -run ^'$'\n- focused local runs with LLVM 14, 18, 19, 20, and LLVM 22 forward compatibility\n- actionlint .github/workflows/coroutine.yml\n

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces ssa/coro.go and its corresponding tests in ssa/coro_test.go. It implements CoroBuilder and related configurations to emit target-independent LLVM switched-resume coroutine control flow and frame allocation. I have no feedback to provide as there are no review comments to assess.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@cpunion
cpunion merged commit 5bb9da2 into llvm-coro Jul 15, 2026
5 checks passed
@cpunion
cpunion deleted the coro/phase5-llvm-builder branch July 15, 2026 17:20
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.

1 participant