#include "AArch64InstrInfo.h"
#include "AArch64MachineFunctionInfo.h"
#include "AArch64Subtarget.h"
#include "Utils/AArch64SMEAttributes.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
struct SMEPeepholeOpt : public MachineFunctionPass { … };
char SMEPeepholeOpt::ID = …;
}
static bool isConditionalStartStop(const MachineInstr *MI) { … }
static bool isMatchingStartStopPair(const MachineInstr *MI1,
const MachineInstr *MI2) { … }
static bool ChangesStreamingMode(const MachineInstr *MI) { … }
static bool isSVERegOp(const TargetRegisterInfo &TRI,
const MachineRegisterInfo &MRI,
const MachineOperand &MO) { … }
bool SMEPeepholeOpt::optimizeStartStopPairs(
MachineBasicBlock &MBB, bool &HasRemovedAllSMChanges) const { … }
INITIALIZE_PASS(…)
bool SMEPeepholeOpt::runOnMachineFunction(MachineFunction &MF) { … }
FunctionPass *llvm::createSMEPeepholeOptPass() { … }