I decided to complete saga with ptx instructions which can be generated with popular compilers and check clang with NVPTX target
Gathering from LLVM source files with PTX instructions turned out to be a challenging task. The Usual Suspects NVPTXInstrInfo.td & NVPTXIntrinsics.td lay in directory llvm/lib/Target/NVPTX, but they don't contain operation definitions. For unknown reason file NVVMOps.td located in mlir/include/mlir/Dialect/LLVMIR/ - don't ask me why
Then I add new option -N to my long-suffering iptx.pl to collect PTX instructions. As you can see it's not true parser - it just extracting any strings and then try to find matches in set of PTX instructions. Dirty & ugly hack but since we lookup on small dictionary with only 270 instruction it works in near-linear time. Another problem is that strings with instruction names can be modified like append operands etc. Well, since cicc itself based on LLVM - if some instruction marked as missed in clang it's highly likely also will be marked as missed in cicc too, so the obtained sets are sufficient for the comparison task
Results
Check two files:
- ptx-cicc.txt - set of PTX instructions which cicc can't produce. As you can see coverage 57.8%
- ptx-nv.txt - set of PTX instructions which clang can't produce for NVPTX. Coverage 58.9%
And instructions missed in clang (but presented in cicc) are:
- _ldsm
- _mma
- discard
- dp2a hi/lo
- madc hi/lo
- p2r
- trap