Skip to content

Commit

Permalink
Fix static check error on ubuntu22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaojbao committed Dec 20, 2024
1 parent 0fced47 commit 1873e38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lgc/builder/MatrixBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ Value *BuilderImpl::CreateMatrixTimesVector(Value *const matrix, Value *const ve
else
result = partialResult;
}

result->setName(instName);
if (result)
result->setName(instName);
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion lgc/patch/LowerInvariantLoads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ PreservedAnalyses LowerInvariantLoads::run(Function &function, FunctionAnalysisM

LLVM_DEBUG(dbgs() << (clearInvariants ? "Removing invariant load flags"
: "Attempting aggressive invariant load optimization")
<< "\n";);
<< "\n");

// This mirrors AMDGPUAliasAnalysis
static const unsigned aliasMatrix[] = {
Expand Down
11 changes: 7 additions & 4 deletions llpc/context/llpcCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2459,9 +2459,10 @@ Result Compiler::BuildGraphicsPipeline(const GraphicsPipelineBuildInfo *pipeline

if (!cacheAccessor || !cacheAccessor->isInCache()) {
LLPC_OUTS("Cache miss for graphics pipeline.\n");
GraphicsContext graphicsContext(m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
result = buildGraphicsPipelineInternal(&graphicsContext, shaderInfo, buildUsingRelocatableElf, &candidateElf,
GraphicsContext *graphicsContext = new GraphicsContext(m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
result = buildGraphicsPipelineInternal(graphicsContext, shaderInfo, buildUsingRelocatableElf, &candidateElf,
pipelineOut->stageCacheAccesses);
delete graphicsContext;

if (result == Result::Success) {
elfBin.codeSize = candidateElf.size();
Expand Down Expand Up @@ -2588,9 +2589,11 @@ Result Compiler::BuildComputePipeline(const ComputePipelineBuildInfo *pipelineIn
ElfPackage candidateElf;
if (!cacheAccessor || !cacheAccessor->isInCache()) {
LLPC_OUTS("Cache miss for compute pipeline.\n");
ComputeContext computeContext(m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
result = buildComputePipelineInternal(&computeContext, pipelineInfo, buildUsingRelocatableElf, &candidateElf,
ComputeContext *computeContext =
new ComputeContext(m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
result = buildComputePipelineInternal(computeContext, pipelineInfo, buildUsingRelocatableElf, &candidateElf,
&pipelineOut->stageCacheAccess);
delete computeContext;

if (cacheAccessor && pipelineOut->pipelineCacheAccess == CacheAccessInfo::CacheNotChecked)
pipelineOut->pipelineCacheAccess = CacheAccessInfo::CacheMiss;
Expand Down

0 comments on commit 1873e38

Please sign in to comment.