Skip to content

Commit 40cb8d9

Browse files
committed
Update llpc from commit 58d887ee
lgc: Handle primitiveShadingRate in ShaderStage Tessellation evaluation shader Update SPIR-V header to latest public version Completely remove dead codes gated by earlier version (< 70) [NFC] Coding style changes of buffre resource helpers [llvmraytracing] Handle intersection case for the RayTCurrent function Disable FMF Reassoc for FMix operation Rename useGfx10StyleParamExport to attributeThroughExport in LGC lgc: add compile option 'stridedBufferOverrideMode' [LGC] Initialize undef output variables [llvmraytracing] Fix deprecation warning. [lgc] New Shader Invocation Reordering Dialects [llvmraytracing] Move statistics reporting to 'CleanupContinuations' Support untyped pointer in cooperative matrix [NFC] Rename in/out reader/writer functions [test/tools] Rename stable ir value test file [llvmraytracing] Report statistics per function Update Create{Min/Max}Num API for new LLVM upstream [Continuations] Add reload on resume mode Add support for SPV_EXT_optnone [LGC] Use llvm.amdgcn.dead with init.whole.wave lgc: force dummy export when the fs is NullFs or no outputs Add support for SPV_EXT_arithmetic_fence Move TF optimization to HS body [LGC] Set correct perSampleShading state on gfx12 [llvmraytracing] Remove 'nocapture readnone' capture from tests Emit SQTT shader hash tokens in RT shaders [Continuations][NFC] Add unused value and fragmentation analysis Adjust for upstream Triple change lgc : SubgroupBroadcastFirst behavior with only helperlanes lgccps: Special handling for GpurtGetRayQueryDispatchIdOp [NFC] Some renaming in LLPC frontend [NFC] Some renaming in LGC lgc: Improve waterfall Loop handling for descriptor pointers Turn sequence of load/store into memcpy Build traversal module with persistent dispatch [lgc][LowerBufferOperations] Fix OOB condition for strided buffers Fix missing PromotePass on Navi2x for mesh shader [llvmraytracing] Remove unused function declaration [llvmraytracing] Make lgc.ilcps.(wait)continue only accept a variadic argument list Use Uniform initializer for LoadStorePair constructor Replace builtin inputs by function arguments for transform shader [llvmraytracing] Introduce lgc.cps.dead dialect op [llvmraytracing] Add dummy hit attribute argument LGC: Set PsIterSample to true when enable VRS Add support for OpUntypedVariable without the data type Optimize the unused elements Get rid of the redundant SPV binary file in pipe test Assert for global stacks without persistent dispatch [NFC] Add clang-format pre-commit hook Replace builtin inputs by function arguments for transform shader Unroll the loop that contains dynamic input variables [LGC] Set correct perSampleShading state on gfx12 cmake: Fatal error if LLVM not found Add sched_barrier to block the move of s_wait_event cmake: Have *_BUILD_* variables forced on when PAL_BUILD_FORCE_ON is true [Continuations] Add spill on suspend mode New operators for check the RTIP version lgc: follow-up for the refactor of waterfall loop [LGC] Make test robust to use of poison instead undef Remove LLPC_BUILD_GFX11/GFX115 in CMake lgc : Add Constant check for beginWaterfallLoop Detect more read-only buffers Clean up GPURT_CLIENT_INTERFACE_MAJOR_VERSION check Create gl_FrontFacing with the type of i32 [LGC] Fix per-component case for loop unroll Remove RayTracingShaderIdentifierExtraBits [Continuations] Add & enable eviction in the cont-state-builder Use setLdsByteSize in registerMetadataBuilder llvmraytracing: add new shader entry point for when Raygen shader resumes execution Implicit HitObjects Refactor Align raytracing functions to 128B llvmraytracing: fix shader-exit.ll test Disable structured buffers by default for gfx12 and below lgc: Remove option forceNullFsDummyExport Support cooperative matrix conversion from Acc to A [vkgc] Add Vkgc::IUtil function to get symbol disassembly from ELF binary [LGC] Add convert.lgc test [LGC] GfxIp11_0 ShadingRate add check for MaskNone [LGC] Use Triple object as targetMachine input [LGC] Update use of CreateIntrinsic due to upstream change Temporarily disable eviction in cont-state-builder Remove LLPC_BUILD_GFX12 macro Fixed nested loop [llvmraytracing] Remove incoming register count metadata lgc: Initial graphics partial pipeline support [LGC] Trim .outgoing_vgpr_count lgc: Remove disableProvokingVertexMode [LGC] Fix Cooperative Matrix convert Support hawk point 2 lgc: place irrelevant instructions out of the waterfall loop Add missing support for untyped pointer in some validations lgc: SamplePosOffset and InterpLocSample with aux value should not cause sample rate. Initialize unbound vertices Add support for GpurtOptions in non-RT pipelines with RayQuery [llvmraytracing] Move 'splitIntoI32' helper to 'compilerutils' [LGC] Change the dummy export value to <0.0, poison, poison, poison> [LGC] Implement cooperative matrix transpose on gfx12 Fix error on raytracing entry kernels that use more than 16 VGPRs lgc: update expFormat and cbShaderMask to valid values for alpha2Coverage without bound MRTs [LGC] Combine coopmat fill and conversion Support OpCooperativeMatrixTransposeNV Implement VK_KHR_shader_relaxed_extended_instruction support [NFC] Fix 'unused variable' warnings [lgcdis] skip outputting instr offset for single symbol disassembly [NFC] Use unique_ptr for MCInstPrinter [llvmraytracing] Add transitional support for ShaderExit [llvmraytracing] Fix unused warnings in 'ContStateBuilder' [NFC] Fix compiler warnings Remove 'AmdValue*' handling from 'ProcessGpurtLibrary' Always use EXCLUDE_FROM_ALL property for LLVM sub directory in llvm.cmake Update llvm-dialects submodule Clean up after GpurtOptions change Update test due to upstream LLVM change Disable gfx11 TessFactorStoreWithOpt [LGC] Fix ldexp problems with i8/i64 exponent
1 parent 188bbf6 commit 40cb8d9

File tree

757 files changed

+19871
-7574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

757 files changed

+19871
-7574
lines changed

CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@
3737

3838
cmake_minimum_required(VERSION 3.21)
3939

40-
project(LLPCrepo LANGUAGES C CXX)
41-
4240
set(LLPC_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
4341

4442
### Standalone LLPC build handling
4543
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
4644
include(cmake/CompilerStandalone.cmake)
45+
llpc_standalone_pre_project_setup()
46+
endif()
47+
48+
project(LLPCrepo LANGUAGES C CXX)
49+
50+
### Standalone LLPC build handling
51+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
52+
llpc_standalone_post_project_setup()
4753
set(LLPC_IS_STANDALONE ON)
4854
endif()
4955

@@ -123,7 +129,12 @@ if(ICD_BUILD_LLPC)
123129
target_link_libraries(vkgc INTERFACE llpc)
124130
endif()
125131

126-
# Set sub library properties
132+
### Post-processing for standalone compiler build #################################
133+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
134+
include(cmake/PostCompilerStandalone.cmake)
135+
endif()
136+
137+
### Set sub library properties ####################################################
127138
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
128139

129140
if (TARGET dumper)

cmake/CompilerStandalone.cmake

Lines changed: 64 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,78 @@
2323
#
2424
#######################################################################################################################
2525

26-
# Settings required for a standalone LLPC build that would otherwise be inherited from the driver.
26+
macro(llpc_standalone_pre_project_setup)
27+
endmacro()
2728

28-
if(COMMAND cmake_policy)
29-
cmake_policy(SET CMP0003 NEW)
30-
endif(COMMAND cmake_policy)
29+
macro(llpc_standalone_post_project_setup)
30+
# Settings required for a standalone LLPC build that would otherwise be inherited from the driver.
3131

32-
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../pal)
33-
set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../pal)
34-
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal)
35-
set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal)
36-
endif()
32+
if(COMMAND cmake_policy)
33+
cmake_policy(SET CMP0003 NEW)
34+
endif(COMMAND cmake_policy)
3735

38-
if(EXISTS ${PROJECT_SOURCE_DIR}/../third_party)
39-
set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../third_party)
40-
elseif(EXISTS ${PROJECT_SOURCE_DIR}/../../../../third_party)
41-
set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../../../../third_party)
42-
endif()
43-
if (THIRD_PARTY)
44-
set(XGL_METROHASH_PATH ${THIRD_PARTY}/metrohash CACHE PATH "The path of metrohash.")
45-
set(XGL_CWPACK_PATH ${THIRD_PARTY}/cwpack CACHE PATH "The path of cwpack.")
46-
add_subdirectory(${XGL_METROHASH_PATH} ${PROJECT_BINARY_DIR}/metrohash)
47-
add_subdirectory(${XGL_CWPACK_PATH} ${PROJECT_BINARY_DIR}/cwpack)
48-
endif()
36+
set(LLPC_STANDALONE_BUILD ON)
37+
set(LLPC_BUILD_TESTS ON)
4938

50-
# Enable LLPC if we found its prerequisites (and it is not explicitly disabled).
51-
if (NOT DEFINED ICD_BUILD_LLPC)
52-
if (THIRD_PARTY AND PAL_SOURCE_DIR)
53-
set(ICD_BUILD_LLPC ON)
54-
else()
55-
message(STATUS "Vulkan-LLPC prerequisites not found; disabling")
39+
if(NOT PAL_SOURCE_DIR)
40+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../pal)
41+
set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../pal)
42+
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal)
43+
set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal)
44+
endif()
45+
endif()
46+
47+
if(NOT GPURT_SOURCE_DIR)
48+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../gpurt)
49+
set(GPURT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../gpurt)
50+
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/gpurt)
51+
set(GPURT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/gpurt)
52+
endif()
5653
endif()
57-
endif()
58-
if (ICD_BUILD_LLPC)
59-
set(LLPC_BUILD_TESTS ON)
60-
set(LLPC_BUILD_TOOLS ON)
6154

62-
# External Vulkan headers path
63-
if(EXISTS ${PROJECT_SOURCE_DIR}/../Vulkan-Headers)
64-
set(VULKAN_HEADERS_PATH ${PROJECT_SOURCE_DIR}/../Vulkan-Headers CACHE PATH "The path of Vulkan headers.")
55+
if(EXISTS ${PROJECT_SOURCE_DIR}/../third_party)
56+
set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../third_party)
57+
elseif(EXISTS ${PROJECT_SOURCE_DIR}/../../../../third_party)
58+
set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../../../../third_party)
59+
endif()
60+
if (THIRD_PARTY)
61+
set(XGL_METROHASH_PATH ${THIRD_PARTY}/metrohash CACHE PATH "The path of metrohash.")
62+
set(XGL_CWPACK_PATH ${THIRD_PARTY}/cwpack CACHE PATH "The path of cwpack.")
63+
add_subdirectory(${XGL_METROHASH_PATH} ${PROJECT_BINARY_DIR}/metrohash)
64+
add_subdirectory(${XGL_CWPACK_PATH} ${PROJECT_BINARY_DIR}/cwpack)
6565
endif()
6666

67-
### Khronos Interface
68-
add_library(khronos_vulkan_interface INTERFACE)
69-
if(EXISTS ${VULKAN_HEADERS_PATH})
70-
target_include_directories(khronos_vulkan_interface INTERFACE ${VULKAN_HEADERS_PATH}/include)
71-
target_compile_definitions(khronos_vulkan_interface INTERFACE EXTERNAL_VULKAN_HEADERS=1)
67+
# Enable LLPC if we found its prerequisites (and it is not explicitly disabled).
68+
if (NOT DEFINED ICD_BUILD_LLPC)
69+
if (THIRD_PARTY AND PAL_SOURCE_DIR)
70+
set(ICD_BUILD_LLPC ON)
71+
else()
72+
message(STATUS "Vulkan-LLPC prerequisites not found; disabling")
73+
endif()
7274
endif()
73-
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../xgl)
74-
target_include_directories(khronos_vulkan_interface INTERFACE ../xgl/icd/api/include/khronos)
75-
else()
76-
target_include_directories(khronos_vulkan_interface INTERFACE ../../../icd/api/include/khronos)
75+
if (ICD_BUILD_LLPC)
76+
set(LLPC_BUILD_TOOLS ON)
77+
78+
# External Vulkan headers path
79+
if(EXISTS ${PROJECT_SOURCE_DIR}/../Vulkan-Headers)
80+
set(VULKAN_HEADERS_PATH ${PROJECT_SOURCE_DIR}/../Vulkan-Headers CACHE PATH "The path of Vulkan headers.")
81+
endif()
82+
83+
### Khronos Interface
84+
add_library(khronos_vulkan_interface INTERFACE)
85+
if(EXISTS ${VULKAN_HEADERS_PATH})
86+
target_include_directories(khronos_vulkan_interface INTERFACE ${VULKAN_HEADERS_PATH}/include)
87+
target_compile_definitions(khronos_vulkan_interface INTERFACE EXTERNAL_VULKAN_HEADERS=1)
88+
endif()
89+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../xgl)
90+
target_include_directories(khronos_vulkan_interface INTERFACE ../xgl/icd/api/include/khronos)
91+
else()
92+
target_include_directories(khronos_vulkan_interface INTERFACE ../../../icd/api/include/khronos)
93+
endif()
7794
endif()
78-
endif()
7995

80-
set(GPURT_CLIENT_INTERFACE_MAJOR_VERSION 999999)
81-
set(LLPC_CLIENT_INTERFACE_MAJOR_VERSION 999999)
82-
set(PAL_CLIENT_INTERFACE_MAJOR_VERSION 999999)
96+
set(GPURT_CLIENT_INTERFACE_MAJOR_VERSION 999999)
97+
set(LLPC_CLIENT_INTERFACE_MAJOR_VERSION 999999)
98+
set(PAL_CLIENT_INTERFACE_MAJOR_VERSION 999999)
99+
100+
endmacro()

lgc/test/Transforms/CpsLoweringWithDvgpr/lit.local.cfg renamed to cmake/PostCompilerStandalone.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##
22
#######################################################################################################################
33
#
4-
# Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All Rights Reserved.
4+
# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved.
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
77
# of this software and associated documentation files (the "Software"), to
@@ -23,5 +23,5 @@
2323
#
2424
#######################################################################################################################
2525

26-
if "llpc_build_gfx12" not in config.available_features:
27-
config.unsupported = True
26+
# Standalone compiler build post-processing, after adding all compiler targets.
27+

cmake/findllvm.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##
22
#######################################################################################################################
33
#
4-
# Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved.
4+
# Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All Rights Reserved.
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
77
# of this software and associated documentation files (the "Software"), to
@@ -35,3 +35,7 @@ if (NOT LLPC_LLVM_SRC_PATH)
3535
endif()
3636
set(LLPC_LLVM_SRC_PATH ${DEFAULT_LLPC_LLVM_SRC_PATH} CACHE PATH "Specify the path to LLVM." FORCE)
3737
endif()
38+
39+
if (NOT EXISTS ${LLPC_LLVM_SRC_PATH}/include/llvm/IR/LLVMContext.h)
40+
message(FATAL_ERROR "LLVM source not found at ${LLPC_LLVM_SRC_PATH}")
41+
endif()

cmake/llpc_version.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(LLPC_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
2828
# Function to set variable named ${varName} to the first of:
2929
#
3030
# - the value it already has (which might be set by driver or developer);
31+
# - ON if PAL_BUILD_FORCE_ON and the variable name matches PAL_BUILD_* (after prefix replacement to PAL);
3132
# - the value of the variable whose name has PAL_ instead of LLPC_ (which might be set by driver or developer);
3233
# - the given default.
3334
#
@@ -41,8 +42,14 @@ set(LLPC_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
4142
function(llpc_set_property target scope varName default propertyName)
4243
if (NOT DEFINED ${varName})
4344
string(REGEX REPLACE "^[A-Z][A-Z]*_(.*)$" "PAL_\\1" palVarName "${varName}")
45+
string(REGEX MATCH "^(PAL_BUILD).*" _match ${palVarName})
46+
4447
if (DEFINED ${palVarName})
4548
set(${varName} ${${palVarName}})
49+
elseif ((PAL_BUILD_FORCE_ON) AND (_match))
50+
# If the user has requested that we force BUILD settings on, then
51+
# force the setting on (if it matches a PAL_BUILD* variable and isn't explicitly overridden).
52+
set(${varName} ON)
4653
else()
4754
set(${varName} ${default})
4855
endif()

cmake/llvm.cmake

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ endif()
7777
if (NOT LLPC_LLVM_BUILD_PATH)
7878
set(LLPC_LLVM_BUILD_PATH ${PROJECT_BINARY_DIR}/llvm)
7979
endif()
80-
if (ICD_BUILD_LLPC)
81-
add_subdirectory(${LLPC_LLVM_SRC_PATH} ${LLPC_LLVM_BUILD_PATH})
82-
else()
83-
add_subdirectory(${LLPC_LLVM_SRC_PATH} ${LLPC_LLVM_BUILD_PATH} EXCLUDE_FROM_ALL)
84-
endif()
80+
81+
add_subdirectory(${LLPC_LLVM_SRC_PATH} ${LLPC_LLVM_BUILD_PATH} EXCLUDE_FROM_ALL)
8582

8683
# Get LLVMConfig onto cmake path.
8784
list(APPEND CMAKE_MODULE_PATH

cmake/vkgc.cmake

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ add_library(vkgc_headers INTERFACE)
3232
target_link_libraries(vkgc_headers INTERFACE llpc_version)
3333

3434
### Options that affect the headers ####################################################################################
35-
#if LLPC_BUILD_GFX11
36-
if(LLPC_BUILD_GFX11)
37-
target_compile_definitions(vkgc_headers INTERFACE LLPC_BUILD_GFX11)
38-
endif()
39-
#endif
40-
41-
#if LLPC_BUILD_GFX12
42-
if(LLPC_BUILD_GFX12)
43-
target_compile_definitions(vkgc_headers INTERFACE LLPC_BUILD_GFX12)
44-
endif()
45-
#endif
4635

4736
#if LLPC_RAY_TRACING
4837
if(LLPC_RAY_TRACING)

compilerutils/include/compilerutils/CompilerUtils.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,49 @@ void setIsLastUseLoad(llvm::LoadInst &Load);
8686
// Handle early returns, ensure the function has only one return instruction
8787
llvm::ReturnInst *unifyReturns(llvm::Function &function, llvm::IRBuilder<> &builder, const llvm::Twine &blockName = "");
8888

89+
// Utility method templates to read and write IR metadata, used by PipelineState and ShaderModes
90+
//
91+
// Get a metadata node containing an array of i32 values, which can be read from any type.
92+
// The array is trimmed to remove trailing zero values. If the whole array would be 0, then this function
93+
// returns nullptr.
94+
//
95+
// @param context : LLVM context
96+
// @param value : Value to write as array of i32
97+
// @param atLeastOneValue : True to generate node with one value even if all values are zero
98+
template <typename T>
99+
static llvm::MDNode *getArrayOfInt32MetaNode(llvm::LLVMContext &context, const T &value, bool atLeastOneValue) {
100+
llvm::IRBuilder<> builder(context);
101+
static_assert(sizeof(value) % sizeof(unsigned) == 0, "Bad value type");
102+
llvm::ArrayRef<unsigned> values(reinterpret_cast<const unsigned *>(&value), sizeof(value) / sizeof(unsigned));
103+
104+
while (!values.empty() && values.back() == 0) {
105+
if (values.size() == 1 && atLeastOneValue)
106+
break;
107+
values = values.slice(0, values.size() - 1);
108+
}
109+
if (values.empty())
110+
return nullptr;
111+
112+
llvm::SmallVector<llvm::Metadata *, 8> operands;
113+
for (unsigned value : values)
114+
operands.push_back(llvm::ConstantAsMetadata::get(builder.getInt32(value)));
115+
return llvm::MDNode::get(context, operands);
116+
}
117+
118+
// Read an array of i32 values out of a metadata node, writing into any type.
119+
// Returns the number of i32s read.
120+
//
121+
// @param metaNode : Metadata node to read from
122+
// @param [out] value : Value to write into (caller must zero initialize)
123+
template <typename T> static unsigned readArrayOfInt32MetaNode(const llvm::MDNode *metaNode, T &value) {
124+
static_assert(sizeof(value) % sizeof(unsigned) == 0, "Bad value type");
125+
llvm::MutableArrayRef<unsigned> values(reinterpret_cast<unsigned *>(&value), sizeof(value) / sizeof(unsigned));
126+
unsigned count = std::min(metaNode->getNumOperands(), unsigned(values.size()));
127+
for (unsigned index = 0; index < count; ++index)
128+
values[index] = llvm::mdconst::extract<llvm::ConstantInt>(metaNode->getOperand(index))->getZExtValue();
129+
return count;
130+
}
131+
89132
struct CrossModuleInlinerResult {
90133
llvm::Value *returnValue;
91134
llvm::iterator_range<llvm::Function::iterator> newBBs;
@@ -135,6 +178,10 @@ class CrossModuleInliner {
135178
// target module.
136179
llvm::GlobalValue *findCopiedGlobal(llvm::GlobalValue &sourceGv, llvm::Module &targetModule);
137180

181+
// Register the type remapping for values when we want to inline other module functions.
182+
// Return true if register successfully, otherwise return false.
183+
bool registerTypeRemapping(llvm::Type *sourceType, llvm::Type *targetType);
184+
138185
// Default implementation that finds global values using getCrossModuleName.
139186
static llvm::GlobalValue &defaultGetGlobalInModuleFunc(CrossModuleInliner &inliner, llvm::GlobalValue &sourceGv,
140187
llvm::Module &targetModule);
@@ -167,6 +214,16 @@ llvm::Value *simplifyingCreateConstGEP1_32(llvm::IRBuilder<> &builder, llvm::Typ
167214
llvm::Value *simplifyingCreateConstInBoundsGEP1_32(llvm::IRBuilder<> &builder, llvm::Type *ty, llvm::Value *ptr,
168215
uint32_t idx);
169216

217+
// =====================================================================================================================
218+
// Split the input into pieces of i32.
219+
//
220+
// @param layout : Data layout
221+
// @param builder : IR builder
222+
// @param input : A collection of inputs (structures, arrays, vectors, pointers, or basic primitive types)
223+
// @param [out] output : A collection of outputs by flattening the inputs to scalar values
224+
void splitIntoI32(const llvm::DataLayout &layout, llvm::IRBuilder<> &builder, llvm::ArrayRef<llvm::Value *> input,
225+
llvm::SmallVector<llvm::Value *> &output);
226+
170227
namespace bb {
171228
std::string getLabel(const llvm::Function *func);
172229
std::string getLabel(const llvm::BasicBlock *bb);

compilerutils/include/compilerutils/ModuleBunch.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
***********************************************************************************************************************
33
*
4-
* Copyright (c) 2023-2024 Advanced Micro Devices, Inc. All Rights Reserved.
4+
* Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All Rights Reserved.
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to
@@ -61,6 +61,9 @@ class ModuleBunch {
6161
size_t size() const { return end() - begin(); }
6262
bool empty() const { return size() == 0; }
6363

64+
// Clear the list of modules. This does not need renormalize() after it.
65+
void clear() { Modules.clear(); }
66+
6467
// Access the array of Modules in the ModuleBunch, directly accessing the unique_ptrs
6568
// for erasing/removing/replacing them.
6669
// After doing that, call renormalize() to remove any holes.

0 commit comments

Comments
 (0)