LLVM 20.0.0git
Macros | Typedefs | 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>

Go to the source code of this file.

Macros

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

Typedefs

using RegisterSet = SmallSet< unsigned, 4 >
 

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.
 
static void ClearKillFlags (MachineInstr *MI, RegisterSet &Uses)
 Clear kill flags for any uses in the given set.
 
static bool isCopy (MachineInstr *MI)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "thumb2-it"

Definition at line 33 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.

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 112 of file Thumb2ITBlockPass.cpp.

References MI, and Uses.

◆ isCopy()

static bool isCopy ( MachineInstr MI)
static

Definition at line 122 of file Thumb2ITBlockPass.cpp.

References MI.

◆ 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 MI, TRI, and Uses.