llvm-project
b63d9d74 - [CIR][CUDA] Support PseudoObjectExpr and CUDA builtin variables

Commit
1 day ago
[CIR][CUDA] Support PseudoObjectExpr and CUDA builtin variables Implement emitPseudoObjectRValue and fix VisitPseudoObjectExpr in the scalar emitter to call it instead of errorNYI. Also remove the errorNYI guard for unique OpaqueValueExprs in the PseudoObjectExpr emission loop, matching the behavior of classic CodeGen. This unblocks CUDA builtin variable access (threadIdx, blockIdx, blockDim, gridDim) which goes through PseudoObjectExpr in the AST. Combined with the NVPTX builtin infrastructure already upstream (PR #195214), these variables now lower to cir.call_llvm_intrinsic "nvvm.read.ptx.sreg.*" operations via the generic intrinsic path. Partially addresses llvm/llvm-project#179278.
Committer
Codex
Parents
Loading