LLVM
8.0.1
|
#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/CodeGen/TargetInstrInfo.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 <algorithm>
#include <cassert>
#include <cstdint>
#include <functional>
#include <iterator>
#include <utility>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "t2-reduce-size" |
#define | THUMB2_SIZE_REDUCE_NAME "Thumb2 instruction size reduce pass" |
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") | |
INITIALIZE_PASS (Thumb2SizeReduce, DEBUG_TYPE, THUMB2_SIZE_REDUCE_NAME, false, false) Thumb2SizeReduce | |
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) |
#define DEBUG_TYPE "t2-reduce-size" |
Definition at line 47 of file Thumb2SizeReduction.cpp.
Definition at line 48 of file Thumb2SizeReduction.cpp.
|
static |
Definition at line 255 of file Thumb2SizeReduction.cpp.
References llvm::MCInstrDesc::getImplicitDefs().
Referenced by isHighLatencyCPSR().
INITIALIZE_PASS | ( | Thumb2SizeReduce | , |
DEBUG_TYPE | , | ||
THUMB2_SIZE_REDUCE_NAME | , | ||
false | , | ||
false | |||
) |
Definition at line 242 of file Thumb2SizeReduction.cpp.
References llvm::array_lengthof(), and llvm_unreachable.
|
static |
Definition at line 263 of file Thumb2SizeReduction.cpp.
References llvm::ARMCC::AL, llvm::ARMSubtarget::avoidCPSRPartialUpdate(), llvm::SmallSet< T, N, C >::count(), llvm::ARMISD::FMSTAT, llvm::MachineInstr::getDesc(), llvm::MachineInstr::getOpcode(), HasImplicitCPSRDef(), llvm::SmallSet< T, N, C >::insert(), MI, llvm::MachineInstr::operands(), and Reg.
Referenced by UpdateCPSRUse().
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 |
Definition at line 973 of file Thumb2SizeReduction.cpp.
References llvm::MachineInstr::operands().
Referenced by UpdateCPSRUse().
|
static |
Definition at line 989 of file Thumb2SizeReduction.cpp.
References assert(), llvm::ReversePostOrderTraversal< GraphT, GT >::begin(), E, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::ReversePostOrderTraversal< GraphT, GT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::MachineInstr::findRegisterDefOperand(), llvm::MachineInstr::findRegisterUseOperand(), llvm::MachineFunction::getFunction(), llvm::ARMSubtarget::getInstrInfo(), llvm::MachineBasicBlock::getNumber(), llvm::MachineFunction::getNumBlockIDs(), llvm::MachineInstr::getOpcode(), llvm::MachineFunction::getSubtarget(), I, Info, llvm::MachineBasicBlock::instr_begin(), llvm::MachineBasicBlock::instr_end(), llvm::MachineInstr::isBundle(), llvm::MachineInstr::isCall(), llvm::MachineOperand::isDead(), llvm::MachineInstr::isDebugInstr(), isHighLatencyCPSR(), llvm::MachineInstr::isInsideBundle(), llvm::MachineOperand::isKill(), llvm::MachineBasicBlock::isLiveIn(), llvm::MachineBasicBlock::isSuccessor(), llvm::ARMSubtarget::isThumb1Only(), llvm::MachineInstr::killsRegister(), MI, Modified, llvm::MachineInstr::operands(), llvm::Function::optForMinSize(), llvm::Function::optForSize(), llvm::MachineBasicBlock::predecessors(), llvm::ARMSubtarget::prefers32BitThumb(), and UpdateCPSRDef().
|
static |
Definition at line 375 of file Thumb2SizeReduction.cpp.
References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::ARMCC::AL, assert(), llvm::ARMSubtarget::avoidMOVsShifterOperand(), llvm::BuildMI(), llvm::TargetInstrInfo::CommuteAnyOperandIndex, llvm::condCodeOp(), llvm::RegState::Dead, 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_DEBUG, LLVM_FALLTHROUGH, llvm_unreachable, llvm::MachineInstr::mayLoadOrStore(), llvm::MachineInstr::memoperands(), llvm::MachineInstr::memoperands_begin(), llvm::MCInstrDesc::OpInfo, llvm::Function::optForMinSize(), llvm::predOps(), ReduceLimit, ReduceLimit2Addr, ReduceLimitLdSt, Reg, llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setIsDef(), llvm::MachineOperand::setIsKill(), llvm::MachineInstrBuilder::setMemRefs(), llvm::MachineInstrBuilder::setMIFlags(), and llvm::t1CondCodeOp().
Referenced by VerifyLowRegs().
Referenced by VerifyLowRegs().
Referenced by VerifyLowRegs().