-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lgc: Report unfolded original threadgroup size when overrideThreadGroupSize is set [CMake] Add header files to Lgc CMake file [NFC] Rename class PatchNullFragShader to GenerateNullFragmentShader Add module data cache to vkCreateShaderModule Replace CreateGEP with CreateInBoundsGEP Make decodeInOutMetaRecursively() as a utility function [Continuations] Improve error message [Continuations] Remove invalid assert [Continuations] Remove continuation state argument from 'lgc.cps' functions lgc/shaderdbg: patch the relocation table according to the mapping table from SDL lgc: Mark applicable LgcDialect and Builder ops as NoDivergenceSource Fix CTS issues of optimizing PointSize write [Continuations] Write CFG to Dot [LowerBufferOperations] Check for uniform buffer pointers for s_buffer_load Add GL state into per-stage hash [compilerutils] Make ensureUnifiedReturn() as a utility function lgc: Allow rayGen local resource to be uniform [Continuations] Use UTC_AVOID on custom lit tests. [LGC] Emit readfirstlane intrinsic for the uniform argument of the image Heuristically determine uniform image descriptor/sampler [NFC] Change pass StringRef name [RT] Revamp hit attribute handling [LGC] Optimize Output Export Calls by Eliminating Redundant Bitcasts for 32-bit Floats [lgc] Fix tests with shared libs Fix InsertPosition deprecation warnings Update checks of two lgc tests for build errors Adjust the layout of tessellation input LDS [Continuations] Cleanup 'CleanupContinuations' pass Import the shader option viewIndexFromDeviceIndex [Continuations] Clean up lgc.cps branching in 'LowerRaytracingPipeline' llvmraytracing: Rename ShaderStageMetadata to RtShaderStageMetadata lgc: call setUserDataSpillUsage if option forceUserDataSpill is set Clean up macros and build options [NFC] Rename pass PatchPeepholeOpt to PeepholeOptimization. Remove traces of LLPC_ENABLE_EXCEPTION Split CPS Stack Lowering from Entry Point Mutate [Continuations] Propagate llpc_version interface compile definitions to lit config Remove old LLVM_MAIN_REVISION checks [LowerBufferOperations] Fix invalid read of descriptor info [NFC] Rename file Patch to LgcLower in the LGC stage Promote llvm-dialects submodule [NFC] Rename pass PatchPreparePipelineAbi to PreparePipelineAbi Fix a NGG culling regression [llvmraytracing] Fix unused variable warnings in release builds [NFC] Rename pass PatchReadFirstLane to LowerReadFirstLane. Avoid "hides overloaded virtual function" warning [lgc/test] Add tests for uniform strided buffers [LowerBufferOperations] Do not add stride to buffer descriptors if we generate s_buffer_loads [NFC] Rename pass PatchResourceCollect to CollectResourceUsage [llvmraytracing] Improve replacement of lgc.cps.jump in 'CpsStackLowering' Some minor fixes of GS message [Continuations] Utility for writing module to a file lgc: add contract flag on adjustIj [cmake] Update cmake/macro options names Fix fragment outputs for graphics pipeline library [llvmraytracing] Linter: Check for await calls Refactor multi-threaded compiles, add parallelForWithContext lgc: Error on leftover dialect ops on debug build Use overload of CreateIntrinsic with implicit mangling [llvmraytracing] Unfold struct argument for resume functions Move ModuleBunch into compilerutils [llvmraytracing] Fix unused variable warning [llvmraytracing] Add getStartFunc helper Move MbStandardInstrumentations into compilerutils rt: fix multi-threaded compiles Preserve afn flag for gl_Position lgc: update comments of the descriptor argument in CreateImage* interface [LGC] Fix the build error for sparse matrix [NFC] Rename pass PatchWorkarounds to ApplyWorkarounds. [Continuations] Remove legacy await handling from 'SpecializeDriverShaders' Fix lgc test runtime error: FDot2Gfx1010.lgc [Continuations] Return 'void' from shaders. Fix amdllpc shadertest error: standalone.rmiss [Continuations] Cache replaced intrinsics lgc: support column major int4 cooperative matrix on gfx11 ImageBuilder: re-add the flag check for enforceReadfirstlane Update tests for new LLVM upstream
- Loading branch information
Showing
486 changed files
with
8,989 additions
and
31,086 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## | ||
####################################################################################################################### | ||
# | ||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to | ||
# deal in the Software without restriction, including without limitation the | ||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
# sell copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
# IN THE SOFTWARE. | ||
# | ||
####################################################################################################################### | ||
|
||
if (NOT LLPC_LLVM_SRC_PATH) | ||
# Find LLVM source. Allow client driver to override using its own name for overlay builds. | ||
set(DEFAULT_LLPC_LLVM_SRC_PATH ${XGL_LLVM_SRC_PATH}) | ||
if (NOT DEFAULT_LLPC_LLVM_SRC_PATH) | ||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../../../imported/llvm-project/llvm) | ||
set(DEFAULT_LLPC_LLVM_SRC_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../imported/llvm-project/llvm) | ||
elseif(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../../llvm-project/llvm) | ||
set(DEFAULT_LLPC_LLVM_SRC_PATH ${CMAKE_CURRENT_LIST_DIR}/../../llvm-project/llvm) | ||
endif() | ||
endif() | ||
set(LLPC_LLVM_SRC_PATH ${DEFAULT_LLPC_LLVM_SRC_PATH} CACHE PATH "Specify the path to LLVM.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
## | ||
####################################################################################################################### | ||
# | ||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to | ||
# deal in the Software without restriction, including without limitation the | ||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
# sell copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
# IN THE SOFTWARE. | ||
# | ||
####################################################################################################################### | ||
|
||
# Build LLVM, using previously set up LLVM_EXTERNAL_PROJECTS and LLVM_EXTERNAL_*_SOURCE_DIR. | ||
# Relies on findllvm.cmake being run first. | ||
|
||
if (NOT LLPC_LLVM_SRC_PATH) | ||
message(FATAL_ERROR "No LLPC_LLVM_SRC_PATH specified") | ||
endif() | ||
|
||
# Set cached options. | ||
set(LLVMRAYTRACING_BUILD_TESTS ${LLPC_BUILD_TESTS}) | ||
set(LLVM_TARGETS_TO_BUILD AMDGPU CACHE STRING "LLVM targets to build") | ||
set(LLVM_BUILD_TESTS OFF CACHE BOOL "LLVM build tests") | ||
set(LLVM_BUILD_TOOLS ${LLPC_BUILD_LLVM_TOOLS} CACHE BOOL "LLVM build tools") | ||
set(LLVM_BUILD_UTILS OFF CACHE BOOL "LLVM build utils") | ||
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "LLVM include docs") | ||
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "LLVM include examples") | ||
set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "LLVM include go tests") | ||
set(LLVM_INCLUDE_TESTS ${LLPC_BUILD_TESTS} CACHE BOOL "LLVM include tests") | ||
set(LLVM_INCLUDE_TOOLS ON CACHE BOOL "LLVM include tools") | ||
set(LLVM_INCLUDE_UTILS ON CACHE BOOL "LLVM include utils") | ||
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "LLVM enable terminfo") | ||
set(LLVM_RAM_PER_TABLEGEN_JOB 4000 CACHE STRING "LLVM RAM per tablegen job") | ||
set(LLVM_RAM_PER_LINK_JOB 5000 CACHE STRING "LLVM RAM per link job") | ||
if(CMAKE_BUILD_TYPE_DEBUG) | ||
# Build optimized version of llvm-tblgen even in debug builds, for faster build times. | ||
set(LLVM_OPTIMIZED_TABLEGEN ON CACHE BOOL "Build optimized llvm-tblgen") | ||
#if _WIN32 | ||
if(LLVM_OPTIMIZED_TABLEGEN AND WIN32 AND (CMAKE_GENERATOR MATCHES "Ninja")) | ||
# LLVM implements the Release build of llvm-tblgen as a cross-compile target, which fails to find | ||
# our DK-based toolchain (created with amd_generate_msvc_toolchain). However, we can inject the toolchain | ||
# argument into LLVM's add_custom_target that sets up this cross-compile build. | ||
# See: llvm-project/llvm/cmake/modules/CrossCompile.cmake | ||
set(CROSS_TOOLCHAIN_FLAGS_NATIVE "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" CACHE STRING | ||
"Toolchain flags for native build" FORCE) | ||
endif() | ||
#endif | ||
endif() | ||
|
||
# This will greatly speed up debug builds because we won't be listing all the symbols with llvm-nm. | ||
set(LLVM_BUILD_LLVM_C_DYLIB OFF CACHE BOOL "LLVM build LLVM-C dylib") | ||
|
||
# Remove /nologo from CMAKE_RC_FLAGS to avoid getting an error from specifying it twice in LLVM. | ||
if (CMAKE_RC_FLAGS) | ||
string(REPLACE "/nologo" "" CMAKE_RC_FLAGS ${CMAKE_RC_FLAGS}) | ||
endif() | ||
|
||
# Build LLVM. | ||
if (NOT LLPC_LLVM_BUILD_PATH) | ||
set(LLPC_LLVM_BUILD_PATH ${PROJECT_BINARY_DIR}/llvm) | ||
endif() | ||
if (ICD_BUILD_LLPC) | ||
add_subdirectory(${LLPC_LLVM_SRC_PATH} ${LLPC_LLVM_BUILD_PATH}) | ||
else() | ||
add_subdirectory(${LLPC_LLVM_SRC_PATH} ${LLPC_LLVM_BUILD_PATH} EXCLUDE_FROM_ALL) | ||
endif() | ||
|
||
# Get LLVMConfig onto cmake path. | ||
list(APPEND CMAKE_MODULE_PATH | ||
"${LLPC_LLVM_BUILD_PATH}/lib/cmake/llvm" | ||
"${LLPC_LLVM_BUILD_PATH}/${CMAKE_CFG_INTDIR}/lib/cmake/llvm" # Workaround for VS generator with older LLVM. | ||
) | ||
|
||
# Export LLVM build path for client driver. | ||
# TODO: Change uses to LLPC_LLVM_BUILD_PATH. | ||
set(XGL_LLVM_BUILD_PATH ${LLPC_LLVM_BUILD_PATH} PARENT_SCOPE) | ||
|
||
# Extract LLVM revision number for code outside the LLPC repository to use. | ||
file(READ "${LLPC_LLVM_SRC_PATH}/include/llvm/Config/llvm-config.h.cmake" LLVM_CONFIG_HEADER) | ||
string(REGEX MATCH "#define LLVM_MAIN_REVISION ([0-9]+)" "\\1" _ "${LLVM_CONFIG_HEADER}") | ||
set(LLVM_MAIN_REVISION "${CMAKE_MATCH_1}") | ||
set(LLVM_MAIN_REVISION ${LLVM_MAIN_REVISION} PARENT_SCOPE) | ||
|
||
# Some of the games using old versions of the tcmalloc lib are crashing | ||
# when allocating aligned memory. C++17 enables aligned new by default, | ||
# so we need to disable it to prevent those crashes. | ||
if (ICD_BUILD_LLPC AND NOT WIN32) | ||
llvm_map_components_to_libnames(llvm_libs | ||
AMDGPUAsmParser | ||
AMDGPUCodeGen | ||
AMDGPUDisassembler | ||
AMDGPUInfo | ||
Analysis | ||
BinaryFormat | ||
Core | ||
Coroutines | ||
BitReader | ||
BitWriter | ||
CodeGen | ||
InstCombine | ||
ipo | ||
IRPrinter | ||
IRReader | ||
Linker | ||
LTO | ||
MC | ||
Passes | ||
ScalarOpts | ||
Support | ||
Target | ||
TransformUtils | ||
) | ||
foreach (lib ${llvm_libs}) | ||
target_compile_options(${lib} PRIVATE "-fno-aligned-new") | ||
endforeach() | ||
endif() |
Oops, something went wrong.