[llvm-dev] [llc] Producing ptx assembly for different target architectures - possible bug?

Lorenz Braun via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 22 05:44:53 PDT 2018


Hi,

i just found out that i can use llc to also produce ptx assembly for 
GPUs. I noticed that the produced ptx assembly seems to be targeted at 
the gpu architecture sm_20 by default.

Is there a way to explicitly demand different or additional target 
architectures like sm_30 for example?

When i compile a cuda kernel with gpu arch. sm_30 using clang++ the 
.target directive in the ptx assembly will be set to sm_30. However when 
i save the bitcode of the same compilation and hand it to llc the 
.target directive is sm_20. There is an attribute in the bitcode that 
say "target-cpu"="sm_30". The information that sm_30 is required is 
still there. I can imagine that llc might not process this information. 
Could this be a bug?

I am currently using llvm 7.0 and i can provide the bitcode if anyone 
wants to reproduce the problem.

Best regards
Lorenz

-- 
Lorenz Braun
Research Associate
Institute of Computer Engineering (ZITI)
INF 368
Raum 528
69120 Heidelberg

Phone: +49 6221 54-16441
lorenz.braun at ziti.uni-heidelberg.de



More information about the llvm-dev mailing list