Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/lib/CIR/CodeGen/CIRGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ const TargetCIRGenInfo &CIRGenModule::getTargetCIRGenInfo() {
return *(theTargetCIRGenInfo = createSPIRVTargetCIRGenInfo(genTypes));
}

case llvm::Triple::nvptx:
case llvm::Triple::nvptx64: {
return *(theTargetCIRGenInfo = createNVPTXTargetCIRGenInfo(genTypes));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ createTargetLoweringInfo(LowerModule &LM) {
}
case llvm::Triple::spirv64:
return createSPIRVTargetLoweringInfo(LM);

case llvm::Triple::nvptx:
case llvm::Triple::nvptx64:
return createNVPTXTargetLoweringInfo(LM);

default:
cir_cconv_unreachable("ABI NYI");
}
Expand Down
9 changes: 9 additions & 0 deletions clang/test/CIR/CodeGen/CUDA/simple-nvptx-triple.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "../Inputs/cuda.h"

// RUN: %clang_cc1 -triple nvptx -fclangir \
// RUN: -fcuda-is-device -emit-cir -target-sdk-version=12.3 \
// RUN: %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir %s

__device__ void device_fn(int* a, double b, float c) {}
// CHECK: cir.func @_Z9device_fnPidf
Loading