diff --git a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp @@ -593,11 +593,12 @@ for (; I != E; ++I) { std::vector> AddedEdges; int CandSGID = *I; - SchedGroup *Match; + SchedGroup *Match = nullptr; for (auto &SG : SyncPipeline) { if (SG.getSGID() == CandSGID) Match = &SG; } + assert(Match); if (UseCostHeur) { if (Match->isFull()) { @@ -739,11 +740,12 @@ for (; I != E; ++I) { std::vector> AddedEdges; int CandSGID = *I; - SchedGroup *Match; + SchedGroup *Match = nullptr; for (auto &SG : SyncPipeline) { if (SG.getSGID() == CandSGID) Match = &SG; } + assert(Match); LLVM_DEBUG(dbgs() << "Trying SGID # " << CandSGID << " with Mask " << (int)Match->getMask() << "\n");