Skip to content

NVIDIA PTX backend: emit string literal globals as .const arrays  #94

@Zaneham

Description

@Zaneham

PTX backend doesn't lower string literals yet. E110 refusal fires on any device-side "..." until this lands.

Easiest of the three. For each byte-init global, emit .const .align 1 .b8 .strN[len] = { 'h', 'e', ... }; at module scope, and lower BIR_GLOBAL_REF to mov.u64 %rd, .strN. The existing PTX BIR_GLOBAL_REF handler is a no-op stub today, so it's basically a new code path rather than touching anything.

Bytes live at M->strings[c->d.bytes.off], length c->d.bytes.len. bir_global_is_bytes(M, gi) tells you which globals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions