Dear NVPTX community,<br><br>PTXAS fails to compile the ptx code generated by NVPTX. Is it an issue of backend or an issue of PTXAS or a known reasonable restriction?<br><br>Thanks,<br>- Dima.<br><br>> cat test.ll<br>; ModuleID = '__kernelgen_main_module'<br>
target datalayout = "e-p:64:64-i64:64:64-f64:64:64-n1:8:16:32:64"<br>target triple = "ptx64-unknown-unknown"<br><br>%struct.__st_parameter_dt.0.4 = type { %struct.__st_parameter_common.1.5, i64, i64*, i64*, i8*, i8*, i32, i32, i8*, i8*, i32, i32, i8*, [256 x i8], i32*, i64, i8*, i32, i32, i8*, i8*, i32, i32, i8*, i8*, i32, i32, i8*, i8*, i32, [4 x i8] }<br>
%struct.__st_parameter_common.1.5 = type { i32, i32, i8*, i32, i32, i8*, i32* }<br>%"struct.kernelgen::kernel_t.2" = type opaque<br>%struct.kernelgen_callback_data_t.3 = type opaque<br><br>@.cst = hidden constant [11 x i8] c"reduce.f90\00", align 4096<br>
@z = unnamed_addr global i8* getelementptr inbounds ([3 x i8]* @.cst1, i64 0, i64 0), align 4096<br>@.cst1 = hidden constant [3 x i8] c"zz\00", align 4096<br>@a = unnamed_addr global i8* getelementptr inbounds ([3 x i8]* @.cst12, i64 0, i64 0), align 4096<br>
@.cst12 = hidden constant [3 x i8] c"aa\00", align 4096<br>@.cst2 = hidden constant [26 x i8] c"Usage: %s <nx> <ny> <nz>\0A\00", align 4096<br><br>> llc -march=nvptx64 test.ll -o test.ptx<br>
> cat test.ptx<br>//<br>// Generated by LLVM NVPTX Back-End<br>//<br><br>.version 3.0<br>.target sm_10, texmode_independent<br>.address_size 64<br><br>.visible .global .align 4096 .b8 _2E_cst[11] = {114, 101, 100, 117, 99, 101, 46, 102, 57, 48, 0};<br>
.visible .global .align 4096 .u64 z = _2E_cst1;<br>.visible .global .align 4096 .b8 _2E_cst1[3] = {122, 122, 0};<br>.visible .global .align 4096 .u64 a = _2E_cst12;<br>.visible .global .align 4096 .b8 _2E_cst12[3] = {97, 97, 0};<br>
.visible .global .align 4096 .b8 _2E_cst2[26] = {85, 115, 97, 103, 101, 58, 32, 37, 115, 32, 60, 110, 120, 62, 32, 60, 110, 121, 62, 32, 60, 110, 122, 62, 10, 0};<br><br>> ptxas test.ptx -o test.cubin<br>ptxas test.ptx, line 10; error : Unimplemented feature: labels as initial values<br>
ptxas test.ptx, line 12; error : Unimplemented feature: labels as initial values<br>ptxas test.ptx, line 10; error : Label expected for forward reference of '_2E_cst1'<br>ptxas test.ptx, line 12; error : Label expected for forward reference of '_2E_cst12'<br>
ptxas fatal : Ptx assembly aborted due to errors<br><br>