Skip to content

compiler: unify resolved LLVM target configuration - #11

Merged
cpunion merged 2 commits into
llvm-corofrom
coro/phase3-target-config
Jul 15, 2026
Merged

compiler: unify resolved LLVM target configuration#11
cpunion merged 2 commits into
llvm-corofrom
coro/phase3-target-config

Conversation

@cpunion

@cpunion cpunion commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • resolve one shared LLVM triple, CPU, feature set, and target ABI for the driver and SSA backend
  • snapshot requested and effective target specs, using an explicit legacy-surrogate fallback only for unavailable external backends or incompatible Go-visible layouts
  • forward TargetABI through ABIName when creating the LLVM TargetMachine and verify it through emitted RISC-V ELF flags
  • keep ordinary-build cache identities stable while including non-default LLVM configuration in cache keys
  • preserve TargetMachine, TargetData, module, and context ownership across normal and failure paths

Dependency

This branch uses the ABIName binding merged in cpunion/llvm#2 at b20c3fb9f902. The temporary module replacement can be removed after that binding is available from the upstream LLVM module.

Validation

  • full related package tests: internal/xtool/llvm, internal/crosscompile, internal/cabi, ssa, internal/build
  • focused coroutine workflow commands on Go 1.24.11
  • race test for internal/coro
  • RISC-V lp64 versus backend-default lp64d object emission
  • target compatibility audit for AVR, RISC-V, RP2040, WASI, and Nintendo Switch
  • diff check and focused vet

Focused CI note

During coroutine-slice integration this branch intentionally runs the dedicated Coroutine workflow only. SSA keeps all vet analyzers except its pre-existing copylocks findings; the full upstream workflow matrix will be restored before final integration.

@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 support for resolved LLVM target specifications (including target triple, CPU, features, and ABI) across the build, cross-compilation, and SSA packages. It refactors target resolution to use a new TargetSpec struct, allowing fine-grained LLVM configurations while preserving legacy cache identities for default GOOS/GOARCH builds. Additionally, it adds layout compatibility checks to ensure that custom target machines match the Go-visible LLVM object layout, and includes comprehensive tests validating these target configurations and fallbacks. No review comments were provided, so there is no feedback to address.

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 6ddf42b into llvm-coro Jul 15, 2026
2 checks passed
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