LLVM  10.0.0svn
Macros | Enumerations | Functions | Variables
PPCInstrInfo.cpp File Reference
#include "PPCInstrInfo.h"
#include "MCTargetDesc/PPCPredicates.h"
#include "PPC.h"
#include "PPCHazardRecognizers.h"
#include "PPCInstrBuilder.h"
#include "PPCMachineFunctionInfo.h"
#include "PPCTargetMachine.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/CodeGen/SlotIndexes.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"
#include "PPCGenInstrInfo.inc"
Include dependency graph for PPCInstrInfo.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "ppc-instr-info"
 
#define GET_INSTRMAP_INFO
 
#define GET_INSTRINFO_CTOR_DTOR
 

Enumerations

enum  SpillOpcodeKey {
  SOK_Int4Spill, SOK_Int8Spill, SOK_Float8Spill, SOK_Float4Spill,
  SOK_CRSpill, SOK_CRBitSpill, SOK_VRVectorSpill, SOK_VSXVectorSpill,
  SOK_VectorFloat8Spill, SOK_VectorFloat4Spill, SOK_VRSaveSpill, SOK_QuadFloat8Spill,
  SOK_QuadFloat4Spill, SOK_QuadBitSpill, SOK_SpillToVSR, SOK_SPESpill,
  SOK_SPE4Spill, SOK_LastOpcodeSpill
}
 

Functions

 STATISTIC (NumStoreSPILLVSRRCAsVec, "Number of spillvsrrc spilled to stack as vec")
 
 STATISTIC (NumStoreSPILLVSRRCAsGpr, "Number of spillvsrrc spilled to stack as gpr")
 
 STATISTIC (NumGPRtoVSRSpill, "Number of gpr spills to spillvsrrc")
 
 STATISTIC (CmpIselsConverted, "Number of ISELs that depend on comparison of constants converted")
 
 STATISTIC (MissedConvertibleImmediateInstrs, "Number of compare-immediate instructions fed by constants")
 
 STATISTIC (NumRcRotatesConvertedToRcAnd, "Number of record-form rotates converted to record-form andi")
 
static unsigned getCRBitValue (unsigned CRBit)
 
static bool MBBDefinesCTR (MachineBasicBlock &MBB)
 
static bool isAnImmediateOperand (const MachineOperand &MO)
 
static unsigned selectReg (int64_t Imm1, int64_t Imm2, unsigned CompareOpc, unsigned TrueReg, unsigned FalseReg, unsigned CRSubReg)
 
static void swapMIOperands (MachineInstr &MI, unsigned Op1, unsigned Op2)
 
static bool isSignExtendingOp (const MachineInstr &MI)
 
static bool isZeroExtendingOp (const MachineInstr &MI)
 

Variables

static cl::opt< boolDisableCTRLoopAnal ("disable-ppc-ctrloop-analysis", cl::Hidden, cl::desc("Disable analysis for CTR loops"))
 
static cl::opt< boolDisableCmpOpt ("disable-ppc-cmp-opt", cl::desc("Disable compare instruction optimization"), cl::Hidden)
 
static cl::opt< boolVSXSelfCopyCrash ("crash-on-ppc-vsx-self-copy", cl::desc("Causes the backend to crash instead of generating a nop VSX copy"), cl::Hidden)
 
static cl::opt< boolUseOldLatencyCalc ("ppc-old-latency-calc", cl::Hidden, cl::desc("Use the old (incorrect) instruction latency calculation"))
 
const unsigned MAX_DEPTH = 1
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "ppc-instr-info"

Definition at line 42 of file PPCInstrInfo.cpp.

◆ GET_INSTRINFO_CTOR_DTOR

#define GET_INSTRINFO_CTOR_DTOR

Definition at line 45 of file PPCInstrInfo.cpp.

◆ GET_INSTRMAP_INFO

#define GET_INSTRMAP_INFO

Definition at line 44 of file PPCInstrInfo.cpp.

Enumeration Type Documentation

◆ SpillOpcodeKey

Enumerator
SOK_Int4Spill 
SOK_Int8Spill 
SOK_Float8Spill 
SOK_Float4Spill 
SOK_CRSpill 
SOK_CRBitSpill 
SOK_VRVectorSpill 
SOK_VSXVectorSpill 
SOK_VectorFloat8Spill 
SOK_VectorFloat4Spill 
SOK_VRSaveSpill 
SOK_QuadFloat8Spill 
SOK_QuadFloat4Spill 
SOK_QuadBitSpill 
SOK_SpillToVSR 
SOK_SPESpill 
SOK_SPE4Spill 
SOK_LastOpcodeSpill 

Definition at line 76 of file PPCInstrInfo.cpp.

Function Documentation

◆ getCRBitValue()

static unsigned getCRBitValue ( unsigned  CRBit)
static

Definition at line 875 of file PPCInstrInfo.cpp.

References assert(), and llvm::MipsISD::Ret.

Referenced by llvm::PPCInstrInfo::copyPhysReg().

◆ isAnImmediateOperand()

static bool isAnImmediateOperand ( const MachineOperand MO)
static

◆ isSignExtendingOp()

static bool isSignExtendingOp ( const MachineInstr MI)
static

◆ isZeroExtendingOp()

static bool isZeroExtendingOp ( const MachineInstr MI)
static

◆ MBBDefinesCTR()

static bool MBBDefinesCTR ( MachineBasicBlock MBB)
static

◆ selectReg()

static unsigned selectReg ( int64_t  Imm1,
int64_t  Imm2,
unsigned  CompareOpc,
unsigned  TrueReg,
unsigned  FalseReg,
unsigned  CRSubReg 
)
static

Definition at line 2247 of file PPCInstrInfo.cpp.

References llvm_unreachable.

Referenced by llvm::PPCInstrInfo::convertToImmediateForm().

◆ STATISTIC() [1/6]

STATISTIC ( NumStoreSPILLVSRRCAsVec  ,
"Number of spillvsrrc spilled to stack as vec"   
)

◆ STATISTIC() [2/6]

STATISTIC ( NumStoreSPILLVSRRCAsGpr  ,
"Number of spillvsrrc spilled to stack as gpr"   
)

◆ STATISTIC() [3/6]

STATISTIC ( NumGPRtoVSRSpill  ,
"Number of gpr spills to spillvsrrc"   
)

◆ STATISTIC() [4/6]

STATISTIC ( CmpIselsConverted  ,
"Number of ISELs that depend on comparison of constants converted"   
)

◆ STATISTIC() [5/6]

STATISTIC ( MissedConvertibleImmediateInstrs  ,
"Number of compare-immediate instructions fed by constants"   
)

◆ STATISTIC() [6/6]

STATISTIC ( NumRcRotatesConvertedToRcAnd  ,
"Number of record-form rotates converted to record-form andi"   
)

◆ swapMIOperands()

static void swapMIOperands ( MachineInstr MI,
unsigned  Op1,
unsigned  Op2 
)
static

Definition at line 3179 of file PPCInstrInfo.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstr::addOperand(), assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::MachineOperand::ChangeToRegister(), llvm::dbgs(), DefMI, llvm::MachineInstr::dump(), E, llvm::PPCInstrInfo::fixupIsDeadOrKill(), llvm::GlobalValue::getAlignment(), llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::PPCInstrInfo::getRegisterInfo(), llvm::TargetRegisterClass::hasSuperClassEq(), llvm::LoadImmediateInfo::Imm, llvm::ImmInstrInfo::ImmMustBeMultipleOf, llvm::ImmInstrInfo::ImmOpcode, llvm::ImmInstrInfo::ImmOpNo, llvm::ImmInstrInfo::ImmWidth, llvm::LoadImmediateInfo::Is64Bit, isAnImmediateOperand(), llvm::ImmInstrInfo::IsCommutative, llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isKill(), llvm::APInt::isSignedIntN(), llvm::MachineRegisterInfo::isSSA(), llvm::ImmInstrInfo::IsSummingOperands, llvm::TargetRegisterInfo::isVirtualRegister(), LLVM_DEBUG, llvm_unreachable, llvm::max(), MI, llvm::PPCII::MO_TOC_LO, llvm::MachineInstr::modifiesRegister(), MRI, llvm::ImmInstrInfo::OpNoForForwarding, llvm::SmallVectorTemplateBase< T >::pop_back(), llvm::SmallVectorTemplateBase< T >::push_back(), Reg, llvm::MachineInstr::RemoveOperand(), llvm::MachineBasicBlock::rend(), llvm::PPCInstrInfo::replaceInstrOperandWithImm(), llvm::PPCInstrInfo::replaceInstrWithLI(), llvm::LoadImmediateInfo::SetCR, llvm::MachineInstr::setDesc(), llvm::MachineRegisterInfo::setRegClass(), llvm::MachineOperand::setTargetFlags(), llvm::ImmInstrInfo::SignedImm, llvm::ImmInstrInfo::TruncateImmTo, llvm::ImmInstrInfo::ZeroIsSpecialNew, and llvm::ImmInstrInfo::ZeroIsSpecialOrig.

Variable Documentation

◆ DisableCmpOpt

cl::opt<bool> DisableCmpOpt("disable-ppc-cmp-opt", cl::desc("Disable compare instruction optimization"), cl::Hidden)
static

◆ DisableCTRLoopAnal

cl:: opt<bool> DisableCTRLoopAnal("disable-ppc-ctrloop-analysis", cl::Hidden, cl::desc("Disable analysis for CTR loops"))
static

◆ MAX_DEPTH

const unsigned MAX_DEPTH = 1

Definition at line 3759 of file PPCInstrInfo.cpp.

◆ UseOldLatencyCalc

cl::opt<bool> UseOldLatencyCalc("ppc-old-latency-calc", cl::Hidden, cl::desc("Use the old (incorrect) instruction latency calculation"))
static

◆ VSXSelfCopyCrash

cl::opt<bool> VSXSelfCopyCrash("crash-on-ppc-vsx-self-copy", cl::desc("Causes the backend to crash instead of generating a nop VSX copy"), cl::Hidden)
static