Skip to content

dcompute: Prepare pointer ABI rewrite for Vulkan support - #5282

Merged
thewilsonator merged 1 commit into
ldc-developers:masterfrom
gnavdev28:dcompute-abi-refactor
Sep 7, 2026
Merged

dcompute: Prepare pointer ABI rewrite for Vulkan support#5282
thewilsonator merged 1 commit into
ldc-developers:masterfrom
gnavdev28:dcompute-abi-refactor

Conversation

@gnavdev28

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings September 7, 2026 10:52
@gnavdev28
gnavdev28 marked this pull request as draft September 7, 2026 10:53
@gnavdev28
gnavdev28 force-pushed the dcompute-abi-refactor branch from 8b2c90e to c1332be Compare September 7, 2026 10:55
@gnavdev28
gnavdev28 marked this pull request as ready for review September 7, 2026 10:56

Copilot AI 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.

🟡 Changes recommended

The new wasm-ld direct-linking condition applies to Emscripten as well, which likely breaks expected .js outputs and toolchain behavior, and should be corrected before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Prepares the dcompute/Vulkan path and updates LLVM-compatibility shims (notably for LLVM 24), while extending compute-target identification and ABI-rewrite behavior to support upcoming SPIR-V/Vulkan pointer ABI changes.

Changes:

  • Add Vulkan as a dcompute reflection/codegen target (kept in sync between druntime and LDC).
  • Add/adjust LLVM version conditionals for LLVM 24 API changes (passes, debug info, alignment, assembler option plumbing, float ABI queries).
  • Extend dcompute pointer ABI rewrite to emit SPIR-V pointer-type assignment metadata for Vulkan.
File summaries
File Description
runtime/druntime/src/ldc/dcompute.d Adds ReflectTarget.Vulkan to match compiler-side target IDs.
gen/passes/Passes.h Adds LLVM 24 PassInfoMixin compatibility aliasing.
gen/irstate.cpp Adjusts alignment API usage for LLVM 24 (getAlign() vs legacy).
gen/dibuilder.cpp Switches dbg.value emission APIs for LLVM 24 and refactors version-conditional handling.
gen/dcompute/target.h Adds DComputeTarget::ID::Vulkan.
gen/dcompute/abi-rewrites.h Adds Vulkan-specific SPIR-V pointer-type assignment intrinsic call + argument attr adjustments.
gen/abi/arm.cpp Updates hard-float ABI detection for LLVM 24.
driver/toobj.cpp Updates integrated assembler disable query namespace for LLVM 24 (llvm::mc vs llvm::codegen).
driver/targetmachine.cpp Extends compute-target detection to SPIR-V triples; adjusts FloatABI option setting for LLVM 24.
driver/linker-gcc.cpp Updates float-ABI arch naming for LLVM 24 and adds wasm direct-linking path; alters user linker-switch forwarding.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread gen/dcompute/abi-rewrites.h Outdated
Comment on lines +35 to +37
auto ptr = toDcomputePointer(static_cast<TypeStruct *>(dty)->sym);
llvm::Type *elemTy = DtoType(ptr->type);
int realAS = gIR->dcomputetarget->mapping[ptr->addrspace];
Comment thread runtime/phobos
@gnavdev28
gnavdev28 force-pushed the dcompute-abi-refactor branch from 7be1e28 to d11b841 Compare September 7, 2026 11:11
@thewilsonator
thewilsonator merged commit acac528 into ldc-developers:master Sep 7, 2026
23 checks passed
@gnavdev28
gnavdev28 deleted the dcompute-abi-refactor branch September 7, 2026 16:43
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.

4 participants