[PATCH] D101430: [AMDGPU] Refactor hazard recognition IsHazardFn and IsExpiredFn

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 28 01:27:20 PDT 2021


foad added a comment.

> I do not think it is broken per-say but definitely confusing.

I think it is broken because we are looping over predecessors trying to find the most recent hazard. The early-out allows the search to terminate if the hazard in some predecessor was too long ago, but then we would miss the fact that another predecessor might have a more recent hazard.

> Looking at all the IsExpired implementations, none of them use this functionality (or at least not correctly).

But I think they do? Notably the one in `getWaitStatesSince(IsHazardFn IsHazard, int Limit)`:

  auto IsExpiredFn = [Limit] (MachineInstr *, int WaitStates) {
    return WaitStates >= Limit;
  };

But also the one in checkFPAtomicToDenormModeHazard.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101430



More information about the llvm-commits mailing list