llvm-project/clang/lib/CodeGen/CMakeLists.txt
Alex Voicu dd5d65adb6 [HIP][Clang][CodeGen] Add CodeGen support for hipstdpar
This patch adds the CodeGen changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. This change relaxes restrictions on what gets emitted on the device path, when compiling in `hipstdpar` mode:

1. Unless a function is explicitly marked `__host__`, it will get emitted, whereas before only `__device__` and `__global__` functions would be emitted;
2. Unsupported builtins are ignored as opposed to being marked as an error, as the decision on their validity is deferred to the `hipstdpar` specific code selection pass;
3. We add a `hipstdpar` specific pass to the opt pipeline, independent of optimisation level:
    - When compiling for the host, iff the user requested it via the `--hipstdpar-interpose-alloc` flag, we add a pass which replaces canonical allocation / deallocation functions with accelerator aware equivalents.

A test to validate that unannotated functions get correctly emitted is added as well.

Reviewed by: yaxunl, efriedma

Differential Revision: https://reviews.llvm.org/D155850
2023-10-17 11:41:36 +01:00

132 lines
2.1 KiB
CMake

set(LLVM_LINK_COMPONENTS
AggressiveInstCombine
Analysis
BitReader
BitWriter
CodeGenTypes
Core
Coroutines
Coverage
Demangle
Extensions
FrontendHLSL
FrontendOpenMP
HIPStdPar
IPO
IRPrinter
IRReader
InstCombine
Instrumentation
LTO
Linker
MC
ObjCARCOpts
Object
Passes
ProfileData
ScalarOpts
Support
Target
TargetParser
TransformUtils
)
add_clang_library(clangCodeGen
ABIInfo.cpp
ABIInfoImpl.cpp
BackendUtil.cpp
CGAtomic.cpp
CGBlocks.cpp
CGBuiltin.cpp
CGCUDANV.cpp
CGCUDARuntime.cpp
CGCXX.cpp
CGCXXABI.cpp
CGCall.cpp
CGClass.cpp
CGCleanup.cpp
CGCoroutine.cpp
CGDebugInfo.cpp
CGDecl.cpp
CGDeclCXX.cpp
CGException.cpp
CGExpr.cpp
CGExprAgg.cpp
CGExprCXX.cpp
CGExprComplex.cpp
CGExprConstant.cpp
CGExprScalar.cpp
CGGPUBuiltin.cpp
CGHLSLRuntime.cpp
CGLoopInfo.cpp
CGNonTrivialStruct.cpp
CGObjC.cpp
CGObjCGNU.cpp
CGObjCMac.cpp
CGObjCRuntime.cpp
CGOpenCLRuntime.cpp
CGOpenMPRuntime.cpp
CGOpenMPRuntimeGPU.cpp
CGRecordLayoutBuilder.cpp
CGStmt.cpp
CGStmtOpenMP.cpp
CGVTT.cpp
CGVTables.cpp
CodeGenABITypes.cpp
CodeGenAction.cpp
CodeGenFunction.cpp
CodeGenModule.cpp
CodeGenPGO.cpp
CodeGenTBAA.cpp
CodeGenTypes.cpp
ConstantInitBuilder.cpp
CoverageMappingGen.cpp
ItaniumCXXABI.cpp
MacroPPCallbacks.cpp
MicrosoftCXXABI.cpp
ModuleBuilder.cpp
ObjectFilePCHContainerOperations.cpp
PatternInit.cpp
SanitizerMetadata.cpp
SwiftCallingConv.cpp
TargetInfo.cpp
Targets/AArch64.cpp
Targets/AMDGPU.cpp
Targets/ARC.cpp
Targets/ARM.cpp
Targets/AVR.cpp
Targets/BPF.cpp
Targets/CSKY.cpp
Targets/Hexagon.cpp
Targets/Lanai.cpp
Targets/LoongArch.cpp
Targets/M68k.cpp
Targets/MSP430.cpp
Targets/Mips.cpp
Targets/NVPTX.cpp
Targets/PNaCl.cpp
Targets/PPC.cpp
Targets/RISCV.cpp
Targets/SPIR.cpp
Targets/Sparc.cpp
Targets/SystemZ.cpp
Targets/TCE.cpp
Targets/VE.cpp
Targets/WebAssembly.cpp
Targets/X86.cpp
Targets/XCore.cpp
VarBypassDetector.cpp
DEPENDS
intrinsics_gen
ClangDriverOptions
LINK_LIBS
clangAST
clangAnalysis
clangBasic
clangFrontend
clangLex
clangSerialization
)