[PATCH] D158845: [NFC][AMDGPU] assert we've found a value before use

Jeffrey Byrnes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 07:00:00 PDT 2023


jrbyrnes added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp:597
+    SchedGroup *Match = nullptr;
     for (auto &SG : SyncPipeline) {
       if (SG.getSGID() == CandSGID)
----------------
Can we convert these into std::find_if?

    SchedGroup *Match = std::find_if(
        SyncPipeline.begin(), SyncPipeline.end(),
        [&CandSGID](SchedGroup SG) { return SG.getSGID() == CandSGID; });
    assert(Match != SyncPipeline.end());


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158845/new/

https://reviews.llvm.org/D158845



More information about the llvm-commits mailing list