| Issue |
202323
|
| Summary |
[NVPTX] activated `sm_xx` subtarget features are not respected for ptx `.target` directive
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
kulst
|
LLVM models CUDA's compute capability as both: `-mcpu` values and subtarget features. While most decisions in the backend are based on the activated subtarget features (e.g. [here](https://github.com/llvm/llvm-project/blob/3b15d851b9f15b088b5a903aa8672f65c9ec06f8/llvm/lib/Target/NVPTX/NVPTXSubtarget.h#L101); `SmVersion` is derived from `FullSmVersion` which is [parsed from the activated subtarget features](https://github.com/llvm/llvm-project/blob/3c49429089efff48e3e1fce53682e6a954ee4cbd/llvm/lib/Target/NVPTX/NVPTX.td#L28)), the `.target` directive [only takes the `-mcpu` value into account](https://github.com/llvm/llvm-project/blob/3b15d851b9f15b088b5a903aa8672f65c9ec06f8/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp#L817).
This could lead to situations that the emitted instructions are unknown for the specified compute capability, when the compute capability specified by subtarget features is higher than specified by the subtarget features implied by the cpu.
Godbolt reproducer: https://godbolt.org/z/x1eKhh91M
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs