LLVM  12.0.0git
Macros | Functions
SystemZElimCompare.cpp File Reference
#include "SystemZ.h"
#include "SystemZInstrInfo.h"
#include "SystemZTargetMachine.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/LivePhysRegs.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/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/MC/MCInstrDesc.h"
#include <cassert>
#include <cstdint>
Include dependency graph for SystemZElimCompare.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "systemz-elim-compare"
 

Functions

 STATISTIC (BranchOnCounts, "Number of branch-on-count instructions")
 
 STATISTIC (LoadAndTraps, "Number of load-and-trap instructions")
 
 STATISTIC (EliminatedComparisons, "Number of eliminated comparisons")
 
 STATISTIC (FusedComparisons, "Number of fused compare-and-branch instructions")
 
static bool preservesValueOf (MachineInstr &MI, unsigned Reg)
 
static bool resultTests (MachineInstr &MI, unsigned Reg)
 
static bool isLoadAndTestAsCmp (MachineInstr &MI)
 
static unsigned getCompareSourceReg (MachineInstr &Compare)
 
static bool isAddWithImmediate (unsigned Opcode)
 
static bool isCompareZero (MachineInstr &Compare)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "systemz-elim-compare"

Definition at line 36 of file SystemZElimCompare.cpp.

Function Documentation

◆ getCompareSourceReg()

static unsigned getCompareSourceReg ( MachineInstr Compare)
static

◆ isAddWithImmediate()

static bool isAddWithImmediate ( unsigned  Opcode)
static

◆ isCompareZero()

static bool isCompareZero ( MachineInstr Compare)
static

Definition at line 501 of file SystemZElimCompare.cpp.

References llvm::MachineInstrBuilder::add(), llvm::LivePhysRegs::addLiveOuts(), llvm::MachineInstrBuilder::addReg(), llvm::MachineInstrBuilder::addRegMask(), assert(), llvm::MachineBasicBlock::begin(), llvm::MCID::Branch, llvm::SystemZ::CCMASK_ICMP, llvm::SmallVectorImpl< T >::clear(), llvm::MCID::Compare, llvm::SystemZII::CompareAndBranch, llvm::SystemZII::CompareAndReturn, llvm::SystemZII::CompareAndSibcall, llvm::SystemZII::CompareAndTrap, llvm::LivePhysRegs::contains(), llvm::RegState::Dead, llvm::MachineInstr::definesRegister(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), F(), getCompareSourceReg(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineInstr::getNumExplicitOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), llvm::MachineInstr::hasUnmodeledSideEffects(), I, llvm::RegState::ImplicitDefine, llvm::MachineInstr::isCall(), llvm::MachineInstr::isCompare(), llvm::MachineOperand::isImm(), isLoadAndTestAsCmp(), llvm::MachineOperand::isReg(), llvm::MachineInstr::mayRaiseFPException(), MBB, MBBI, preservesValueOf(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineInstr::readsRegister(), Register, llvm::MachineInstr::RemoveOperand(), llvm::MachineBasicBlock::rend(), resultTests(), llvm::MachineInstr::setDesc(), llvm::SmallVectorBase< SmallVectorSizeType< T > >::size(), TII, and TRI.

◆ isLoadAndTestAsCmp()

static bool isLoadAndTestAsCmp ( MachineInstr MI)
static

◆ preservesValueOf()

static bool preservesValueOf ( MachineInstr MI,
unsigned  Reg 
)
static

◆ resultTests()

static bool resultTests ( MachineInstr MI,
unsigned  Reg 
)
static

◆ STATISTIC() [1/4]

STATISTIC ( BranchOnCounts  ,
"Number of branch-on-count instructions  
)

◆ STATISTIC() [2/4]

STATISTIC ( LoadAndTraps  ,
"Number of load-and-trap instructions  
)

◆ STATISTIC() [3/4]

STATISTIC ( EliminatedComparisons  ,
"Number of eliminated comparisons"   
)

◆ STATISTIC() [4/4]

STATISTIC ( FusedComparisons  ,
"Number of fused compare-and-branch instructions  
)