[all-commits] [llvm/llvm-project] a35b59: [CIR][CUDA][HIP] Add NVPTX target info and CUDA/HI...
David Rivera via All-commits
all-commits at lists.llvm.org
Tue Feb 3 03:19:02 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a35b5940b44e4e3b9b1be98ca1b3e0b2743943ff
https://github.com/llvm/llvm-project/commit/a35b5940b44e4e3b9b1be98ca1b3e0b2743943ff
Author: David Rivera <davidriverg at gmail.com>
Date: 2026-02-03 (Tue, 03 Feb 2026)
Changed paths:
M clang/lib/CIR/CodeGen/CIRGenModule.cpp
M clang/lib/CIR/CodeGen/CIRGenModule.h
M clang/lib/CIR/CodeGen/TargetInfo.cpp
M clang/lib/CIR/CodeGen/TargetInfo.h
A clang/test/CIR/CodeGenCUDA/filter-decl.cu
A clang/test/CIR/CodeGenCUDA/nvptx-basic.cu
Log Message:
-----------
[CIR][CUDA][HIP] Add NVPTX target info and CUDA/HIP global emission filtering (#177827)
related: #175871
This patch adds foundational infra for device-side CUDA/HIP compilation
by introducing NVPTX target info and implementing the global emission
filtering logic.
NVPTX Target Info to allows us to compile against that triple:
- Add NVPTXABIInfo and NVPTXTargetCIRGenInfo classes
- Wire up nvptx and nvptx64 triples in getTargetCIRGenInfo()
- Add createNVPTXTargetCIRGenInfo() factory function
CUDA/HIP Global Emission Filtering (most of this is boilerplate from the
AST) This basically narrows down to:
- Skip host-only functions (no `__device__` attribute) when
`-fcuda-is-device`
- Skip device-only functions (device without host) on host side
- Always emit ` __global__` kernels and `__host__` `__device__`
functions on both sides
- Add `shouldEmitCUDAGlobalVar()` to handle variable emission
(device/constant/shared variables)
- Handle special cases: implicit host/device templates, lambda call
operators
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list