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

This pass inserts branches on the 0 exec mask over divergent branches branches when it's expected that jumping over the untaken control flow will be cheaper than having every workitem no-op through it. More...

#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "SIInstrInfo.h"
#include "SIMachineFunctionInfo.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/IR/CallingConv.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h"
#include <cassert>
#include <cstdint>
#include <iterator>
Include dependency graph for SIInsertSkips.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "si-insert-skips"
 

Functions

static INITIALIZE_PASS(SIInsertSkips, DEBUG_TYPE, "SI insert s_cbranch_execz instructions", false, false) char &llvm bool opcodeEmitsNoInsts (unsigned Opc)
 

Variables

static cl::opt< unsignedSkipThresholdFlag ("amdgpu-skip-threshold", cl::desc("Number of instructions before jumping over divergent control flow"), cl::init(12), cl::Hidden)
 

Detailed Description

This pass inserts branches on the 0 exec mask over divergent branches branches when it's expected that jumping over the untaken control flow will be cheaper than having every workitem no-op through it.

Definition in file SIInsertSkips.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "si-insert-skips"

Definition at line 41 of file SIInsertSkips.cpp.

Function Documentation

◆ opcodeEmitsNoInsts()

static INITIALIZE_PASS (SIInsertSkips, DEBUG_TYPE, "SI insert s_cbranch_execz instructions", false, false) char &llvm bool opcodeEmitsNoInsts ( unsigned  Opc) &
static

Definition at line 93 of file SIInsertSkips.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::CallingConv::AMDGPU_GS, llvm::CallingConv::AMDGPU_PS, assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::MachineFunction::back(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), E, llvm::ISD::EH_LABEL, llvm::SmallVectorBase::empty(), llvm::WebAssembly::End, llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::MachineInstr::eraseFromParent(), llvm::Function::getCallingConv(), llvm::MachineInstr::getDebugLoc(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::MachineFunction::getInfo(), llvm::HexagonInstrInfo::getInlineAsmLength(), llvm::SISubtarget::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MCAsmInfo::getMaxInstLength(), llvm::MachineOperand::getMBB(), llvm::TargetMachine::getMCAsmInfo(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::SISubtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), I, llvm::MachineFunction::insert(), llvm::MachineOperand::isImm(), llvm::MachineBasicBlock::isLayoutSuccessor(), llvm::AMDGPUISD::KILL, MI, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SIMachineFunctionInfo::returnsVoid(), SkipThresholdFlag, llvm::ARM_MB::ST, llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_empty(), TII, and llvm::RegState::Undef.

Variable Documentation

◆ SkipThresholdFlag

cl::opt<unsigned> SkipThresholdFlag("amdgpu-skip-threshold", cl::desc("Number of instructions before jumping over divergent control flow"), cl::init(12), cl::Hidden)
static

Referenced by opcodeEmitsNoInsts().