Skip to content

Commit 935422c

Browse files
krystian-andrzejewskisys_zuul
authored andcommitted
Revert of commit 2fc2d4de816e79070404497b0eaa6801c94accfc.
Change-Id: I33b4a06bba99fba39b89fffe947cb614787cc29b
1 parent e2732c7 commit 935422c

File tree

2 files changed

+2
-49
lines changed

2 files changed

+2
-49
lines changed

IGC/Compiler/CodeGenPublic.h

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ namespace IGC
280280
SSimplePushInfo simplePushInfoArr[g_c_maxNumberOfBufferPushed];
281281

282282
// Interesting constants for dynamic constant folding
283-
SConstantAddrValue* m_pInterestingConstants = nullptr;
284-
uint m_InterestingConstantsSize = 0;
283+
std::vector<SConstantAddrValue> m_pInterestingConstants;
285284
};
286285

287286
struct SPixelShaderKernelProgram : SKernelProgram
@@ -864,11 +863,6 @@ namespace IGC
864863
{
865864
}
866865

867-
~VertexShaderContext()
868-
{
869-
delete[] programOutput.gatherMap;
870-
delete[] programOutput.m_pInterestingConstants;
871-
}
872866
};
873867

874868
class PixelShaderContext : public CodeGenContext
@@ -886,12 +880,6 @@ namespace IGC
886880
programOutput()
887881
{
888882
}
889-
890-
~PixelShaderContext()
891-
{
892-
delete[] programOutput.gatherMap;
893-
delete[] programOutput.m_pInterestingConstants;
894-
}
895883
};
896884

897885
class GeometryShaderContext : public CodeGenContext
@@ -909,12 +897,6 @@ namespace IGC
909897
programOutput()
910898
{
911899
}
912-
913-
~GeometryShaderContext()
914-
{
915-
delete[] programOutput.gatherMap;
916-
delete[] programOutput.m_pInterestingConstants;
917-
}
918900
};
919901

920902
struct SComputeShaderSecondCompileInput
@@ -958,12 +940,6 @@ namespace IGC
958940
m_slmSize = 0;
959941
}
960942

961-
~ComputeShaderContext()
962-
{
963-
delete[] programOutput.gatherMap;
964-
delete[] programOutput.m_pInterestingConstants;
965-
}
966-
967943
/** get shader's thread group size */
968944
unsigned GetThreadGroupSize();
969945
unsigned GetSlmSizePerSubslice();
@@ -991,12 +967,6 @@ namespace IGC
991967
programOutput()
992968
{
993969
}
994-
995-
~HullShaderContext()
996-
{
997-
delete[] programOutput.gatherMap;
998-
delete[] programOutput.m_pInterestingConstants;
999-
}
1000970
};
1001971

1002972
class DomainShaderContext : public CodeGenContext
@@ -1014,12 +984,6 @@ namespace IGC
1014984
programOutput()
1015985
{
1016986
}
1017-
1018-
~DomainShaderContext()
1019-
{
1020-
delete[] programOutput.gatherMap;
1021-
delete[] programOutput.m_pInterestingConstants;
1022-
}
1023987
};
1024988
class OpenCLProgramContext : public CodeGenContext
1025989
{

IGC/Compiler/FindInterestingConstants.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -368,18 +368,7 @@ void FindInterestingConstants::visitLoadInst(llvm::LoadInst& I)
368368
template<typename ContextT>
369369
void FindInterestingConstants::copyInterestingConstants(ContextT* pShaderCtx)
370370
{
371-
assert(pShaderCtx->programOutput.m_pInterestingConstants == nullptr);
372-
pShaderCtx->programOutput.m_InterestingConstantsSize = static_cast<uint>(m_InterestingConstants.size());
373-
if (pShaderCtx->programOutput.m_InterestingConstantsSize == 0)
374-
{
375-
return;
376-
}
377-
pShaderCtx->programOutput.m_pInterestingConstants = new SConstantAddrValue[pShaderCtx->programOutput.m_InterestingConstantsSize];
378-
memcpy_s(
379-
pShaderCtx->programOutput.m_pInterestingConstants,
380-
pShaderCtx->programOutput.m_InterestingConstantsSize * sizeof(SConstantAddrValue),
381-
m_InterestingConstants.data(),
382-
m_InterestingConstants.size() * sizeof(SConstantAddrValue));
371+
pShaderCtx->programOutput.m_pInterestingConstants = m_InterestingConstants;
383372
}
384373

385374
bool FindInterestingConstants::doFinalization(llvm::Module& M)

0 commit comments

Comments
 (0)