diff --git a/.github/workflows/check-cppcheck-llpc.yml b/.github/workflows/check-cppcheck-llpc.yml index 1f65dfbfd0..59c0403f06 100644 --- a/.github/workflows/check-cppcheck-llpc.yml +++ b/.github/workflows/check-cppcheck-llpc.yml @@ -6,7 +6,7 @@ on: jobs: cppcheck: name: cppcheck - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" steps: - name: Setup environment run: | @@ -19,5 +19,5 @@ jobs: git submodule update --init - name: Run cppcheck run: | - cppcheck -q -j$(( $(nproc) * 4 )) --error-exitcode=1 --std=c++17 --inline-suppr . -i llpc/tool/amdllpc.cpp \ - -I imported/llvm-dialects/include + cppcheck -q -j$(( $(nproc) * 4 )) --error-exitcode=1 --std=c++20 --inline-suppr . \ + -I imported/llvm-dialects/include -i imported -i llpc/unittests -i llvmraytracing diff --git a/lgc/builder/MatrixBuilder.cpp b/lgc/builder/MatrixBuilder.cpp index 742f3ec9ea..555bbc0063 100644 --- a/lgc/builder/MatrixBuilder.cpp +++ b/lgc/builder/MatrixBuilder.cpp @@ -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; } diff --git a/lgc/patch/LowerInvariantLoads.cpp b/lgc/patch/LowerInvariantLoads.cpp index e8dfe23a4d..4ab3f3c05d 100644 --- a/lgc/patch/LowerInvariantLoads.cpp +++ b/lgc/patch/LowerInvariantLoads.cpp @@ -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[] = { diff --git a/llpc/context/llpcCompiler.cpp b/llpc/context/llpcCompiler.cpp index 8371aef8b7..1dbe40065f 100644 --- a/llpc/context/llpcCompiler.cpp +++ b/llpc/context/llpcCompiler.cpp @@ -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(); @@ -2588,9 +2589,10 @@ 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;