diff options
| author | Yong He <yonghe@outlook.com> | 2023-02-16 13:55:32 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-16 13:55:32 -0800 |
| commit | 4c4826d47eeef4675daae4ae53ff76f4d5ebd84a (patch) | |
| tree | ed4af0ded878e4f06e9641ce61d26ffd7c89ccbc /source/slang/slang-emit-cpp.h | |
| parent | eda88e513e8b1e2abc05e9dc8555f237d96472df (diff) | |
Overhaul global inst deduplication and cpp/cuda backend. (#2654)
* Overhaul global inst deduplication and cpp/cuda backend.
* Update IR documentation.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-cpp.h')
| -rw-r--r-- | source/slang/slang-emit-cpp.h | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/source/slang/slang-emit-cpp.h b/source/slang/slang-emit-cpp.h index c5b9f3d9c..ec70b02b8 100644 --- a/source/slang/slang-emit-cpp.h +++ b/source/slang/slang-emit-cpp.h @@ -39,9 +39,6 @@ public: }; virtual void useType(IRType* type); - virtual void emitCall(const HLSLIntrinsic* specOp, IRInst* inst, const IRUse* operands, int numOperands, const EmitOpInfo& inOuterPrec); - virtual void emitTypeDefinition(IRType* type); - virtual void emitSpecializedOperationDefinition(const HLSLIntrinsic* specOp); static UnownedStringSlice getBuiltinTypeName(IROp op); @@ -78,43 +75,21 @@ protected: virtual void emitVarDecorationsImpl(IRInst* var) SLANG_OVERRIDE; virtual void emitGlobalInstImpl(IRInst* inst) SLANG_OVERRIDE; - virtual const UnownedStringSlice* getVectorElementNames(BaseType elemType, Index elemCount); + const UnownedStringSlice* getVectorElementNames(BaseType elemType, Index elemCount); // Replaceable for classes derived from CPPSourceEmitter virtual SlangResult calcTypeName(IRType* type, CodeGenTarget target, StringBuilder& out); - virtual SlangResult calcFuncName(const HLSLIntrinsic* specOp, StringBuilder& out); - virtual SlangResult calcScalarFuncName(HLSLIntrinsic::Op op, IRBasicType* type, StringBuilder& outBuilder); const UnownedStringSlice* getVectorElementNames(IRVectorType* vectorType); - void _maybeEmitSpecializedOperationDefinition(const HLSLIntrinsic* specOp); - void _emitForwardDeclarations(const List<EmitAction>& actions); - void _emitAryDefinition(const HLSLIntrinsic* specOp); - - // Really we don't want any of these defined like they are here, they should be defined in slang stdlib - void _emitAnyAllDefinition(const UnownedStringSlice& funcName, const HLSLIntrinsic* specOp); - void _emitConstructConvertDefinition(const UnownedStringSlice& funcName, const HLSLIntrinsic* specOp); - void _emitConstructFromScalarDefinition(const UnownedStringSlice& funcName, const HLSLIntrinsic* specOp); - void _emitGetAtDefinition(const UnownedStringSlice& funcName, const HLSLIntrinsic* specOp); - void _emitInitDefinition(const UnownedStringSlice& funcName, const HLSLIntrinsic* specOp); - - void _emitSignature(const UnownedStringSlice& funcName, const HLSLIntrinsic* specOp); - void _emitInOutParamType(IRType* type, String const& name, IRType* valueType); - - UnownedStringSlice _getAndEmitSpecializedOperationDefinition(HLSLIntrinsic::Op op, IRType*const* argTypes, Int argCount, IRType* retType); - static TypeDimension _getTypeDimension(IRType* type, bool vecSwap); void _emitAccess(const UnownedStringSlice& name, const TypeDimension& dimension, int row, int col, SourceWriter* writer); - UnownedStringSlice _getScalarFuncName(HLSLIntrinsic::Op operation, IRBasicType* scalarType); - - UnownedStringSlice _getFuncName(const HLSLIntrinsic* specOp); - UnownedStringSlice _getTypeName(IRType* type); SlangResult _calcCPPTextureTypeName(IRTextureTypeBase* texType, StringBuilder& outName); @@ -126,8 +101,6 @@ protected: void _emitInitAxisValues(const Int sizeAlongAxis[kThreadGroupAxisCount], const UnownedStringSlice& mulName, const UnownedStringSlice& addName); - bool _tryEmitInstExprAsIntrinsic(IRInst* inst, const EmitOpInfo& inOuterPrec); - // Emit the actual definition (including intializer list) // of all the witness table objects in `pendingWitnessTableDefinitions`. void _emitWitnessTableDefinitions(); @@ -136,18 +109,9 @@ protected: void _getExportStyle(IRInst* inst, bool& outIsExport, bool& outIsExternC); void _maybeEmitExportLike(IRInst* inst); - HLSLIntrinsic* _addIntrinsic(HLSLIntrinsic::Op op, IRType* returnType, IRType*const* argTypes, Index argTypeCount); - static bool _isVariable(IROp op); Dictionary<IRType*, StringSlicePool::Handle> m_typeNameMap; - Dictionary<const HLSLIntrinsic*, StringSlicePool::Handle> m_intrinsicNameMap; - - IRTypeSet m_typeSet; - RefPtr<HLSLIntrinsicOpLookup> m_opLookup; - HLSLIntrinsicSet m_intrinsicSet; - - HashSet<const HLSLIntrinsic*> m_intrinsicEmitted; HashSet<IRInterfaceType*> m_interfaceTypesEmitted; |
