[Hexagon] Make findLoopInstr member of HexagonInstrInfo

llvm-svn: 328367
This commit is contained in:
Krzysztof Parzyszek 2018-03-23 20:43:02 +00:00
parent 8038dad7db
commit 998df2ca4f
2 changed files with 11 additions and 3 deletions

View File

@ -144,9 +144,9 @@ static unsigned nonDbgMICount(MachineBasicBlock::const_instr_iterator MIB,
/// On Hexagon, we have two instructions used to set-up the hardware loop
/// (LOOP0, LOOP1) with corresponding endloop (ENDLOOP0, ENDLOOP1) instructions
/// to indicate the end of a loop.
static MachineInstr *findLoopInstr(MachineBasicBlock *BB, unsigned EndLoopOp,
MachineBasicBlock *TargetBB,
SmallPtrSet<MachineBasicBlock *, 8> &Visited) {
MachineInstr *HexagonInstrInfo::findLoopInstr(MachineBasicBlock *BB,
unsigned EndLoopOp, MachineBasicBlock *TargetBB,
SmallPtrSet<MachineBasicBlock *, 8> &Visited) const {
unsigned LOOPi;
unsigned LOOPr;
if (EndLoopOp == Hexagon::ENDLOOP0) {
@ -1886,6 +1886,10 @@ bool HexagonInstrInfo::isAccumulator(const MachineInstr &MI) const {
return((F >> HexagonII::AccumulatorPos) & HexagonII::AccumulatorMask);
}
bool HexagonInstrInfo::isBaseImmOffset(const MachineInstr &MI) const {
return getAddrMode(MI) == HexagonII::BaseImmOffset;
}
bool HexagonInstrInfo::isComplex(const MachineInstr &MI) const {
return !isTC1(MI) && !isTC2Early(MI) && !MI.getDesc().mayLoad() &&
!MI.getDesc().mayStore() &&

View File

@ -346,7 +346,11 @@ public:
/// HexagonInstrInfo specifics.
unsigned createVR(MachineFunction *MF, MVT VT) const;
MachineInstr *findLoopInstr(MachineBasicBlock *BB, unsigned EndLoopOp,
MachineBasicBlock *TargetBB,
SmallPtrSet<MachineBasicBlock *, 8> &Visited) const;
bool isBaseImmOffset(const MachineInstr &MI) const;
bool isAbsoluteSet(const MachineInstr &MI) const;
bool isAccumulator(const MachineInstr &MI) const;
bool isAddrModeWithOffset(const MachineInstr &MI) const;