LLVM  6.0.0svn
Macros | Functions | Variables
Thumb2SizeReduction.cpp File Reference
#include "ARM.h"
#include "ARMBaseInstrInfo.h"
#include "ARMSubtarget.h"
#include "MCTargetDesc/ARMBaseInfo.h"
#include "Thumb2InstrInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.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/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <functional>
#include <iterator>
#include <utility>
Include dependency graph for Thumb2SizeReduction.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "t2-reduce-size"
 

Functions

 STATISTIC (NumNarrows, "Number of 32-bit instrs reduced to 16-bit ones")
 
 STATISTIC (Num2Addrs, "Number of 32-bit instrs reduced to 2addr 16-bit ones")
 
 STATISTIC (NumLdSts, "Number of 32-bit load / store reduced to 16-bit ones")
 
static bool HasImplicitCPSRDef (const MCInstrDesc &MCID)
 
static bool isHighLatencyCPSR (MachineInstr *Def)
 
static bool VerifyLowRegs (MachineInstr *MI)
 
static bool UpdateCPSRDef (MachineInstr &MI, bool LiveCPSR, bool &DefCPSR)
 
static bool UpdateCPSRUse (MachineInstr &MI, bool LiveCPSR)
 

Variables

static cl::opt< int > ReduceLimit ("t2-reduce-limit", cl::init(-1), cl::Hidden)
 
static cl::opt< int > ReduceLimit2Addr ("t2-reduce-limit2", cl::init(-1), cl::Hidden)
 
static cl::opt< int > ReduceLimitLdSt ("t2-reduce-limit3", cl::init(-1), cl::Hidden)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "t2-reduce-size"

Definition at line 47 of file Thumb2SizeReduction.cpp.

Function Documentation

◆ HasImplicitCPSRDef()

static bool HasImplicitCPSRDef ( const MCInstrDesc MCID)
static

Definition at line 250 of file Thumb2SizeReduction.cpp.

References llvm::MCInstrDesc::getImplicitDefs(), and Regs.

Referenced by isHighLatencyCPSR().

◆ isHighLatencyCPSR()

static bool isHighLatencyCPSR ( MachineInstr Def)
static

◆ STATISTIC() [1/3]

STATISTIC ( NumNarrows  ,
"Number of 32-bit instrs reduced to 16-bit ones"   
)

◆ STATISTIC() [2/3]

STATISTIC ( Num2Addrs  ,
"Number of 32-bit instrs reduced to 2addr 16-bit ones"   
)

◆ STATISTIC() [3/3]

STATISTIC ( NumLdSts  ,
"Number of 32-bit load / store reduced to 16-bit ones"   
)

◆ UpdateCPSRDef()

static bool UpdateCPSRDef ( MachineInstr MI,
bool  LiveCPSR,
bool DefCPSR 
)
static

Definition at line 939 of file Thumb2SizeReduction.cpp.

References llvm::MachineInstr::operands().

Referenced by UpdateCPSRUse().

◆ UpdateCPSRUse()

static bool UpdateCPSRUse ( MachineInstr MI,
bool  LiveCPSR 
)
static

◆ VerifyLowRegs()

static bool VerifyLowRegs ( MachineInstr MI)
static

Definition at line 370 of file Thumb2SizeReduction.cpp.

References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::AArch64CC::AL, assert(), llvm::ARMSubtarget::avoidMOVsShifterOperand(), llvm::BuildMI(), llvm::condCodeOp(), llvm::RegState::Dead, DEBUG, llvm::RegState::Define, llvm::MachineBasicBlock::erase_instr(), llvm::MachineInstr::eraseFromBundle(), llvm::errs(), getAlignment(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getDesc(), llvm::MachineInstr::getFlags(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::getInstrPredicate(), llvm::getInternalReadRegState(), llvm::getKillRegState(), llvm::MCInstrDesc::getNumOperands(), llvm::MachineInstr::getNumOperands(), llvm::MCInstrDesc::getOpcode(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), getReg(), llvm::MachineInstr::hasOneMemOperand(), llvm::MCInstrDesc::hasOptionalDef(), llvm::isARMLowRegister(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isInternalRead(), llvm::MachineOperand::isKill(), llvm::MCOperandInfo::isOptionalDef(), llvm::MCInstrDesc::isPredicable(), llvm::MCOperandInfo::isPredicate(), llvm::MachineOperand::isReg(), LLVM_FALLTHROUGH, llvm_unreachable, llvm::MachineInstr::mayLoadOrStore(), llvm::MachineInstr::memoperands_begin(), llvm::MachineInstr::memoperands_end(), llvm::MCInstrDesc::OpInfo, llvm::Function::optForMinSize(), llvm::predOps(), ReduceLimit, ReduceLimit2Addr, ReduceLimitLdSt, llvm::MachineInstr::setMemRefs(), llvm::MachineInstrBuilder::setMIFlags(), and llvm::t1CondCodeOp().

Variable Documentation

◆ ReduceLimit

cl::opt<int> ReduceLimit("t2-reduce-limit", cl::init(-1), cl::Hidden)
static

Referenced by VerifyLowRegs().

◆ ReduceLimit2Addr

cl::opt<int> ReduceLimit2Addr("t2-reduce-limit2", cl::init(-1), cl::Hidden)
static

Referenced by VerifyLowRegs().

◆ ReduceLimitLdSt

cl::opt<int> ReduceLimitLdSt("t2-reduce-limit3", cl::init(-1), cl::Hidden)
static

Referenced by VerifyLowRegs().