[PATCH] D56923: [AMDGPU] Fixed hazard recognizer to walk predecessors

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 18 11:10:26 PST 2019


rampitec created this revision.
rampitec added reviewers: critson, nhaehnle, msearles, vpykhtin.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl, arsenm.

Fixes two problems with GCNHazardRecognizer:

1. It only scans up to 5 instructions emitted earlier.
2. It does not take control flow into account. An earlier instruction

from the previous basic block is not necessarily a predecessor.
At the same time a real predecessor block is not scanned.

The patch provides a way to distinguish between scheduler and
hazard recognizer mode. It is OK to work with emitted instructions
in the scheduler because we do not really know what will be emitted
later and its order. However, when pass works as a hazard recognizer
the schedule is already finalized, and we have full access to the
instructions for the whole function, so we can properly traverse
predecessors and their instructions.


https://reviews.llvm.org/D56923

Files:
  lib/Target/AMDGPU/GCNHazardRecognizer.cpp
  lib/Target/AMDGPU/GCNHazardRecognizer.h
  lib/Target/AMDGPU/SIInstrInfo.cpp
  lib/Target/AMDGPU/SIInstrInfo.h
  test/CodeGen/AMDGPU/vmem-vcc-hazard.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56923.182563.patch
Type: text/x-patch
Size: 19264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190118/49eca284/attachment.bin>


More information about the llvm-commits mailing list