34 #define DEBUG_TYPE "arm-mve-vpt" 58 return "MVE VPT block insertion pass";
76 unsigned &NewOpcode) {
78 auto *
Def = RDA->getReachingMIDef(
MI, ARM::VPR);
88 if (!RDA->hasSameReachingDef(
Def,
MI,
Def->getOperand(1).getReg()) ||
89 !RDA->hasSameReachingDef(
Def,
MI,
Def->getOperand(2).getReg()))
101 while (MBIter != EndIter) {
103 unsigned PredReg = 0;
128 while (MBIter != EndIter && VPTInstCnt < 4) {
131 "VPT block pass does not expect Else preds");
132 if (NextPred != Pred)
148 MIBuilder =
BuildMI(Block, MI, dl,
TII->get(NewOpcode));
149 MIBuilder.
addImm(BlockMask);
157 RemovedVCMPs.
insert(VCMP);
159 MIBuilder =
BuildMI(Block, MI, dl,
TII->get(ARM::MVE_VPST));
160 MIBuilder.
addImm(BlockMask);
169 for (
auto *
I : RemovedVCMPs)
170 I->eraseFromParent();
186 RDA = &getAnalysis<ReachingDefAnalysis>();
189 <<
"********** Function: " << Fn.
getName() <<
'\n');
193 Modified |= InsertVPTBlocks(MBB);
const MachineInstrBuilder & add(const MachineOperand &MO) const
instr_iterator instr_begin()
instr_iterator instr_end()
This class represents lattice values for constants.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
This class provides the reaching def analysis.
const ARMBaseInstrInfo * getInstrInfo() const override
AnalysisUsage & addRequired()
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
static unsigned VCMPOpcodeToVPT(unsigned Opcode)
static unsigned getARMVPTBlockMask(unsigned NumInsts)
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
FunctionPass * createMVEVPTBlockPass()
createMVEVPTBlock - Returns an instance of the MVE VPT block insertion pass.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
static MachineInstr * findVCMPToFoldIntoVPST(MachineInstr *MI, ReachingDefAnalysis *RDA, unsigned &NewOpcode)
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Iterator for intrusive lists based on ilist_node.
MachineInstr * getInstr() const
If conversion operators fail, use this method to get the MachineInstr explicitly. ...
void setPreservesCFG()
This function should be called by the pass, iff they do not:
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachineFunctionProperties & set(Property P)
Representation of each machine instruction.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
ARMVCC::VPTCodes getVPTInstrPredicate(const MachineInstr &MI, unsigned &PredReg)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool hasMVEIntegerOps() const
StringRef - Represent a constant reference to a string, i.e.
const MachineOperand & getOperand(unsigned i) const
void finalizeBundle(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
finalizeBundle - Finalize a machine instruction bundle which includes a sequence of instructions star...
Properties which a MachineFunction may have at a given point in time.