LLVM 22.0.0git
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/CodeGen/TargetInstrInfo.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCInstrDesc.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 <cassert>
#include <cstdint>
#include <functional>
#include <iterator>
#include <utility>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "thumb2-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)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "thumb2-reduce-size"

Definition at line 45 of file Thumb2SizeReduction.cpp.

◆ THUMB2_SIZE_REDUCE_NAME

#define THUMB2_SIZE_REDUCE_NAME   "Thumb2 instruction size reduce pass"

Definition at line 46 of file Thumb2SizeReduction.cpp.

Referenced by INITIALIZE_PASS().

Function Documentation

◆ HasImplicitCPSRDef()

bool HasImplicitCPSRDef ( const MCInstrDesc & MCID)
static

Definition at line 252 of file Thumb2SizeReduction.cpp.

References llvm::is_contained().

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( Thumb2SizeReduce ,
DEBUG_TYPE ,
THUMB2_SIZE_REDUCE_NAME ,
false ,
false  )

◆ isHighLatencyCPSR()

bool isHighLatencyCPSR ( MachineInstr * Def)
static

Definition at line 257 of file Thumb2SizeReduction.cpp.

◆ STATISTIC() [1/3]

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

◆ STATISTIC() [2/3]

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

◆ STATISTIC() [3/3]

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

◆ UpdateCPSRDef()

◆ UpdateCPSRUse()

◆ VerifyLowRegs()

Variable Documentation

◆ ReduceLimit

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

◆ ReduceLimit2Addr

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

◆ ReduceLimitLdSt

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