Skip to content

NVPTX assembly emited by LLVM NVPTX backend failed to compile due to u2 type in global #154337

@aikawayataro

Description

@aikawayataro

Example LLVM IR:

source_filename = "test"
target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
target triple = "nvptx64-nvidia-cuda11.0.1-unknown"

@"test_global" = internal unnamed_addr addrspace(1) constant i2 1, align 1

attributes #0 = { noredzone nounwind "frame-pointer"="all" "target-cpu"="sm_80" "target-features"="+ptx70,+sm_80,-ptx32,-ptx40,-ptx41,-ptx42,-ptx43,-ptx50,-ptx60,-ptx61,-ptx62,-ptx63,-ptx64,-ptx65,-ptx71,-ptx72,-ptx73,-ptx74,-ptx75,-ptx76,-ptx77,-ptx78,-ptx80,-ptx81,-ptx82,-ptx83,-ptx84,-ptx85,-ptx86,-ptx87,-sm_100,-sm_100a,-sm_101,-sm_101a,-sm_120,-sm_120a,-sm_20,-sm_21,-sm_30,-sm_32,-sm_35,-sm_37,-sm_50,-sm_52,-sm_53,-sm_60,-sm_61,-sm_62,-sm_70,-sm_72,-sm_75,-sm_86,-sm_87,-sm_89,-sm_90,-sm_90a" }

!llvm.module.flags = !{}

Used to generate assembly with llc -march=nvptx64 -mcpu=sm_80 bug.ll emits the following NVPTX assembly:

//
// Generated by LLVM NVPTX Back-End
//

.version 7.0
.target sm_80
.address_size 64

.global .align 1 .u2 test_global = 1;

ptxas fails to assembly it:

$ ptxas --gpu-name=sm_80 bug.s -o bug.cubin
ptxas bug.s, line 9; fatal   : Parsing error near '.u2': syntax error
ptxas fatal   : Ptx assembly aborted due to errors

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions