LLVM 19.0.0git
SIInsertHardClauses.cpp File Reference

Insert s_clause instructions to form hard clauses. More...

#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineFunctionPass.h"

Go to the source code of this file.


#define DEBUG_TYPE   "si-insert-hard-clauses"

Detailed Description

Insert s_clause instructions to form hard clauses.

Clausing load instructions can give cache coherency benefits. Before gfx10, the hardware automatically detected "soft clauses", which were sequences of memory instructions of the same type. In gfx10 this detection was removed, and the s_clause instruction was introduced to explicitly mark "hard clauses".

It's the scheduler's job to form the clauses by putting similar memory instructions next to each other. Our job is just to insert an s_clause instruction to mark the start of each clause.

Note that hard clauses are very similar to, but logically distinct from, the groups of instructions that have to be restartable when XNACK is enabled. The rules are slightly different in each case. For example an s_nop instruction breaks a restartable group, but can appear in the middle of a hard clause. (Before gfx10 there wasn't a distinction, and both were called "soft clauses" or just "clauses".)

The SIFormMemoryClauses pass and GCNHazardRecognizer deal with restartable groups, not hard clauses.

Definition in file SIInsertHardClauses.cpp.

Macro Definition Documentation


#define DEBUG_TYPE   "si-insert-hard-clauses"

Definition at line 42 of file SIInsertHardClauses.cpp.