LLVM  6.0.0svn
Macros | Functions | Variables
SIInsertWaits.cpp File Reference

Insert wait instructions for memory reads and writes. More...

#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "SIDefines.h"
#include "SIInstrInfo.h"
#include "SIMachineFunctionInfo.h"
#include "SIRegisterInfo.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <utility>
Include dependency graph for SIInsertWaits.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "si-insert-waits"
 

Functions

 INITIALIZE_PASS_BEGIN (SIInsertWaits, DEBUG_TYPE, "SI Insert Waits", false, false) INITIALIZE_PASS_END(SIInsertWaits
 
static bool readsVCCZ (const MachineInstr &MI)
 
static void increaseCounters (Counters &Dst, const Counters &Src)
 helper function for handleOperands More...
 
static bool countersNonZero (const Counters &Counter)
 check whether any of the counters is non-zero More...
 
static bool hasTrivialSuccessor (const MachineBasicBlock &MBB)
 Return true if MBB has one successor immediately following, and is its only predecessor. More...
 

Variables

 DEBUG_TYPE
 
SI Insert Waits
 
SI Insert false
 

Detailed Description

Insert wait instructions for memory reads and writes.

Memory reads and writes are issued asynchronously, so we need to insert S_WAITCNT instructions when we want to access any of their results or overwrite any register that's used asynchronously.

Definition in file SIInsertWaits.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "si-insert-waits"

Definition at line 46 of file SIInsertWaits.cpp.

Function Documentation

◆ countersNonZero()

static bool countersNonZero ( const Counters &  Counter)
static

◆ hasTrivialSuccessor()

static bool hasTrivialSuccessor ( const MachineBasicBlock MBB)
static

◆ increaseCounters()

static void increaseCounters ( Counters &  Dst,
const Counters &  Src 
)
static

helper function for handleOperands

Definition at line 439 of file SIInsertWaits.cpp.

References llvm::max().

Referenced by countersNonZero(), and hasTrivialSuccessor().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( SIInsertWaits  ,
DEBUG_TYPE  ,
"SI Insert Waits ,
false  ,
false   
)

◆ readsVCCZ()

static bool readsVCCZ ( const MachineInstr MI)
static

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 175 of file SIInsertWaits.cpp.

◆ false

SI Insert false

Definition at line 175 of file SIInsertWaits.cpp.

◆ Waits

SI Insert Waits

Definition at line 175 of file SIInsertWaits.cpp.