LLVM  9.0.0svn
Macros | Typedefs | Enumerations | Functions
Thumb2ITBlockPass.cpp File Reference
#include "ARM.h"
#include "ARMMachineFunctionInfo.h"
#include "ARMSubtarget.h"
#include "MCTargetDesc/ARMBaseInfo.h"
#include "Thumb2InstrInfo.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/MachineInstrBundle.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include <cassert>
#include <new>
Include dependency graph for Thumb2ITBlockPass.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "thumb2-it"
 
#define PASS_NAME   "Thumb IT blocks insertion pass"
 
#define DEBUG_TYPE   "arm-mve-vpt"
 

Typedefs

using RegisterSet = SmallSet< unsigned, 4 >
 

Enumerations

enum  VPTMaskValue {
  T = 8, TT = 4, TE = 12, TTT = 2,
  TTE = 6, TEE = 10, TET = 14, TTTT = 1,
  TTTE = 3, TTEE = 5, TTET = 7, TEEE = 9,
  TEET = 11, TETT = 13, TETE = 15
}
 

Functions

 STATISTIC (NumITs, "Number of IT blocks inserted")
 
 STATISTIC (NumMovedInsts, "Number of predicated instructions moved")
 
static void TrackDefUses (MachineInstr *MI, RegisterSet &Defs, RegisterSet &Uses, const TargetRegisterInfo *TRI)
 TrackDefUses - Tracking what registers are being defined and used by instructions in the IT block. More...
 
static void ClearKillFlags (MachineInstr *MI, RegisterSet &Uses)
 Clear kill flags for any uses in the given set. More...
 
static bool isCopy (MachineInstr *MI)
 

Macro Definition Documentation

◆ DEBUG_TYPE [1/2]

#define DEBUG_TYPE   "thumb2-it"

Definition at line 313 of file Thumb2ITBlockPass.cpp.

◆ DEBUG_TYPE [2/2]

#define DEBUG_TYPE   "arm-mve-vpt"

Definition at line 313 of file Thumb2ITBlockPass.cpp.

◆ PASS_NAME

#define PASS_NAME   "Thumb IT blocks insertion pass"

Definition at line 34 of file Thumb2ITBlockPass.cpp.

Typedef Documentation

◆ RegisterSet

using RegisterSet = SmallSet<unsigned, 4>

Definition at line 39 of file Thumb2ITBlockPass.cpp.

Enumeration Type Documentation

◆ VPTMaskValue

Enumerator
TT 
TE 
TTT 
TTE 
TEE 
TET 
TTTT 
TTTE 
TTEE 
TTET 
TEEE 
TEET 
TETT 
TETE 

Definition at line 345 of file Thumb2ITBlockPass.cpp.

Function Documentation

◆ ClearKillFlags()

static void ClearKillFlags ( MachineInstr MI,
RegisterSet Uses 
)
static

Clear kill flags for any uses in the given set.

This will likely conservatively remove more kill flags than are necessary, but removing them is safer than incorrect kill flags remaining on instructions.

Definition at line 113 of file Thumb2ITBlockPass.cpp.

References llvm::MachineInstr::operands().

Referenced by isCopy().

◆ isCopy()

static bool isCopy ( MachineInstr MI)
static

◆ STATISTIC() [1/2]

STATISTIC ( NumITs  ,
"Number of IT blocks inserted"   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumMovedInsts  ,
"Number of predicated instructions moved"   
)

◆ TrackDefUses()

static void TrackDefUses ( MachineInstr MI,
RegisterSet Defs,
RegisterSet Uses,
const TargetRegisterInfo TRI 
)
static

TrackDefUses - Tracking what registers are being defined and used by instructions in the IT block.

This also tracks "dependencies", i.e. uses in the IT block that are defined before the IT instruction.

Definition at line 81 of file Thumb2ITBlockPass.cpp.

References llvm::MCRegisterInfo::DiffListIterator::isValid(), MI, Reg, and TRI.

Referenced by isCopy().