LLVM
8.0.1
|
#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/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>
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 | isCCLiveOut (MachineBasicBlock &MBB) |
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 | isCompareZero (MachineInstr &Compare) |
#define DEBUG_TYPE "systemz-elim-compare" |
Definition at line 36 of file SystemZElimCompare.cpp.
|
static |
Definition at line 179 of file SystemZElimCompare.cpp.
References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), assert(), llvm::MCID::Branch, llvm::BuildMI(), llvm::SystemZ::CCMASK_CMP_EQ, llvm::SystemZ::CCMASK_CMP_NE, llvm::SystemZ::CCMASK_ICMP, llvm::SystemZII::CCMaskFirst, llvm::SystemZII::CCMaskLast, llvm::MCID::Compare, llvm::RegState::Dead, E, llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::MachineInstr::findRegisterDefOperandIdx(), llvm::SystemZII::getCCValues(), llvm::SystemZII::getCompareZeroCCMask(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getDesc(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getNumExplicitOperands(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), I, llvm::RegState::ImplicitDefine, llvm::MachineInstr::isCompare(), isLoadAndTestAsCmp(), llvm::SystemZII::IsLogical, llvm::MachineInstr::memoperands(), MI, llvm::MachineInstr::operands(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::MachineInstr::RemoveOperand(), llvm::MachineInstr::setDesc(), llvm::MachineOperand::setIsDead(), llvm::MachineInstrBuilder::setMemRefs(), llvm::SmallVectorBase::size(), TII, TRI, and llvm::MCInstrDesc::TSFlags.
Referenced by isCompareZero().
|
static |
Definition at line 108 of file SystemZElimCompare.cpp.
References SI, llvm::MachineBasicBlock::succ_begin(), and llvm::MachineBasicBlock::succ_end().
Referenced by isCompareZero().
|
static |
Definition at line 405 of file SystemZElimCompare.cpp.
References llvm::MachineInstrBuilder::add(), 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::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(), I, llvm::RegState::ImplicitDefine, isCCLiveOut(), llvm::MachineInstr::isCompare(), llvm::MachineOperand::isImm(), isLoadAndTestAsCmp(), llvm::MachineOperand::isReg(), preservesValueOf(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineInstr::readsRegister(), llvm::MachineInstr::RemoveOperand(), llvm::MachineBasicBlock::rend(), resultTests(), llvm::MachineInstr::setDesc(), llvm::SmallVectorBase::size(), TII, and TRI.
|
static |
Definition at line 168 of file SystemZElimCompare.cpp.
References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), and llvm::MachineOperand::isDead().
Referenced by getCompareSourceReg(), and isCompareZero().
|
static |
Definition at line 116 of file SystemZElimCompare.cpp.
References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MipsISD::LDR, and Reg.
Referenced by isCompareZero(), and resultTests().
|
static |
Definition at line 139 of file SystemZElimCompare.cpp.
References E, llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), I, if(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), MI, preservesValueOf(), llvm::Ref, Reg, and TRI.
Referenced by isCompareZero().
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" | |||
) |