| Issue |
178140
|
| Summary |
Refactor NVPTX builtins: Move cluster-related intrinsics into static constexpr BuiltinEntry nvvmNames[]
|
| Labels |
backend:NVPTX
|
| Assignees |
|
| Reporter |
woruyu
|
## Description
Currently, the following NVPTX builtins are handled via explicit case statements in the code:
```cpp
case NVPTX::BI__nvvm_read_ptx_sreg_clusterid_x:
return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::nvvm_read_ptx_sreg_clusterid_x));
// ... (other cluster-related cases)
```
However, similar builtins such as `__nvvm_read_ptx_sreg_tid_x` are already managed through the `static constexpr BuiltinEntry nvvmNames[]` table, and there is no special handling required for the cluster-related intrinsics.
## Proposal
Move all cluster-related builtins (e.g., __nvvm_read_ptx_sreg_clusterid_x, __nvvm_read_ptx_sreg_clusterid_y, etc.) into the nvvmNames[] table for consistency and maintainability. This will simplify the code, reduce duplication, and make it easier to add or modify builtins in the future.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs