-
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.
[Continuations] Remove `CONTINUATIONS_USE_DUMMY_RET_ADDR` define [Continuations] Remove references to `_cont_SetupRayGen` [RT] Fix IR verifier error when reading GPURT SPIRVReader: Add LayoutMode::None, remove isParentPointer, m_typeMap, make recordTypeWithPad return void [LGC] Remove descriptor type argument from getDescPtr Fix broken spvasm tests Add support for SPV_EXT_fragment_shader_interlock compilerutils: Put TypeLowering into a namespace Remove RT lit test dependency on SPIR-V binary Fix and cleanup barrier translation Add an check of dual source blend in full pipeline [LGC] Fix deprecation warnings SPIRVReader: Unify OpType{Runtime}Array conversion Fix OpControlBarrier mapping Fix compiling warning of switch cases [LGC] Handle load and build buffer descriptor in PatchBufferOp SPIRVReader: refactor image support [Continuations] Pass padding and payload as argument [Continuations] Fix irreducible cycle during continuation transform Unify the namespace compilerutils with CompilerUtils Rework mesh shader export slot assignment [Continuations] Remove RegisterBuffer pass. [RT] Rayquery refactor to lgc [LGC] Fix cast error when forceRawView buffer load is used [Continuations] Remove `DISABLE_CPS_PAYLOADREG` define. Stop replacing atomicrmw fadd instructions with intrinsics [LGC] Missing index for LoadTfeOp structured load [Continations] Remove comment on register buffer Remove assertion and update tests to align with recent LLVM changes amdllpc: Fix amdllpc test failure PipelineRays_TestStaticCompile.pipe [Continuations] Move `handleGetFuncAddr` amdllpc: Flush SPIR-V output to aid in debugging Make readlane call mangling-agnostic [LGC] Fix deprecated StringRef::equals warning [LGC] Remove use of RepeatedPass [LGC] Include FormatVariadic.h [Continuations] Reformat code SPIRVReader: workaround for some invalid SPIR-V Fix traversal module pop back Extract LowerRayQuery from LGC and move to RT [Continuations] Dialectify `continuation.continue` and `continuation.waitContinue`. Update intrinsic names for upstream change Fix use-after-free in LowerRayQuery refactor Add debug printer for ModuleBunch Stop replacing atomicrmw fmin/fmax instructions with intrinsics Update tests for non-i8 gep of mul change [Continuations] Tidy up assertion in LowerRaytracingPipeline Prefer mdconst::extract over mdconst::dyn_extract Update includes and fwd decls Fix some Clang warnings Enable intrinsic instead of using named call Use range-based set() for SmallBitVector [LGC] Add dereferenceable info for descriptor load [Continuations] Ignore single unreachable in block [CompilerUtils] Handle phi in replaceAllPointerUses Use CreateIntrinsic for building intrinsic calls llvmraytracing: Add getShaderSubtypeForRtShaderStage [Continuations] Refactor metadata handling [RT] Support GpurtGetKnown(Un)SetRayFlagsOp, and add a lit test Fix build and test issue when bumping LLPC version to 73 Move the Dx9MulZero match from llpcSpirvLowerMath into PatchMulDx9Zero which is added after Scalarize Pass llvmraytracing: Add getFuncReturnPtrElementType [RT] Avoid unnecessary compilations for traversal module Fix RTIP-overriding for GPURT rayQuery functions Fix #include file ordering [LGC] Set new .uses_cps PAL metadata where applicable [CompilerUtils] Simplify pointee types metadata [Continuations] Use `lgc.cps.jump` in `LegacyCleanupContinuations` [CompilerUtils] Move promotePointerArguments etc to compilerutils Use function linkage setting from spirv [CompilerUtils] Fix cross-module-inliner tests, and move to subdir [LGC] Add option to force user data spilling Improve continuations heuristic [Continuations] Fix clang-format Remove SpirvLowerRayQuery from lower passes [Continuations] Cleanup continuations analyses, remove registercount + statesize metadata [Continuations] Prevent zero-size `lgc.cps.free` calls in `CleanupContinuations` [LGC] Only insert non null components in reassembleOutputExportCalls [Continuations] Use new `replaceVarArgs` helper from dialects [Continuations] Add constant jump 'inliner' pass [Continuations] Basic Continuations 'linter' pass [Continuations] Introduce lgc.cps.jump in `LowerRaytracingPipeline` Remove explicit LLVM benchmark targets from CMake [Continuations] Handle _AmdValue* intrinsics [LGC] Fix issues of FS without exports Update llvm-dialects submodule Pack mesh shader outputs in LDS space
- Loading branch information
Showing
369 changed files
with
22,595 additions
and
18,389 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
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
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,117 @@ | ||
/* | ||
*********************************************************************************************************************** | ||
* | ||
* 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. | ||
* | ||
**********************************************************************************************************************/ | ||
|
||
//===- TypesMetadata.h - Pointee type metadata for processing DXIL ---------==// | ||
|
||
#pragma once | ||
|
||
#include "llvm/Bitcode/BitcodeReader.h" | ||
|
||
namespace llvm { | ||
|
||
class MDTuple; | ||
|
||
// A function argument type and pointee type. | ||
class TypedArgTy { | ||
private: | ||
Type *ArgTy = nullptr; | ||
Type *ElemTy = nullptr; | ||
|
||
public: | ||
TypedArgTy() {} | ||
TypedArgTy(Type *Arg); | ||
TypedArgTy(Type *Arg, Type *Elem); | ||
|
||
static TypedArgTy get(const Argument *Arg); | ||
static TypedArgTy get(const Function *F, const unsigned ArgNo); | ||
|
||
Type *asType() const { return ArgTy; } | ||
Type *getPointerElementType() const; | ||
|
||
bool isPointerTy() const; | ||
bool isVoidTy() const; | ||
Metadata *getTypeMetadata(LLVMContext &Context); | ||
|
||
bool operator==(const TypedArgTy &RHS) const { return (ArgTy == RHS.ArgTy) && (ElemTy == RHS.ElemTy); } | ||
}; | ||
|
||
// A wrapper round FunctionType and metadata for the pointee type(s) of any pointer return type and parameters. | ||
class TypedFuncTy { | ||
public: | ||
TypedFuncTy() {} | ||
|
||
// Construct a TypedFuncTy for the given result type and arg types. | ||
// This constructs the !pointeetys metadata; that can then be attached to a function | ||
// using writeMetadata(). | ||
TypedFuncTy(TypedArgTy ResultTy, ArrayRef<TypedArgTy> ArgTys); | ||
|
||
// Get a TypedFuncTy for the given Function, looking up the !pointeetys metadata. | ||
static TypedFuncTy get(const Function *F); | ||
|
||
// Get the IR FunctionType. | ||
FunctionType *asFunctionType() const { return FuncTy; } | ||
|
||
// Get a TypedArgTy for the return type. | ||
TypedArgTy getReturnType() const; | ||
|
||
// Get a TypedArgTy for a parameter type. | ||
TypedArgTy getParamType(unsigned Idx) const; | ||
|
||
// Push a TypedArgTy for each parameter onto the supplied vector. | ||
void getParamTypes(SmallVectorImpl<TypedArgTy> &ArgTys) const; | ||
|
||
// Write the metadata (if any) onto the specified function. Typically used when creating a new function | ||
// and using our constructor that takes TypedArgTy for return type and arg types. | ||
void writeMetadata(Function *F) const; | ||
|
||
static constexpr const char *MDTypesName = "pointeetys"; | ||
|
||
private: | ||
// Shared code for getReturnType and getParamType. This decodes the !pointeetys metadata. | ||
Type *getPointeeType(Type *Ty, unsigned Idx) const; | ||
|
||
FunctionType *FuncTy = nullptr; | ||
MDTuple *Meta = nullptr; | ||
}; | ||
|
||
/// Return element type of a function argument resolving opaque pointers | ||
/// via !pointeetys metadata where appropriate. | ||
/// Returns nullptr for non-pointers. | ||
Type *getFuncArgPtrElementType(const Argument *Arg); | ||
|
||
/// Return element type of a function argument resolving opaque pointers | ||
/// via !pointeetys metadata where appropriate. | ||
/// Returns nullptr for non-pointers. | ||
Type *getFuncArgPtrElementType(const Function *F, int ArgNo); | ||
|
||
/// Get element type of function return type resolving opaque pointers | ||
/// via !pointeetys metadata where appropriate. | ||
Type *getFuncReturnPtrElementType(const Function *F); | ||
|
||
/// LLVM parser callback which adds !pointeetys metadata during DXIL parsing | ||
void DXILValueTypeMetadataCallback(Value *V, unsigned TypeID, GetTypeByIDTy GetTypeByID, | ||
GetContainedTypeIDTy GetContainedTypeID); | ||
|
||
} // namespace llvm |
Oops, something went wrong.