#include "ARM.h"
#include "ARMBaseInstrInfo.h"
#include "ARMSubtarget.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
#define DEBUG_TYPE …
static cl::opt<bool>
ForceExapnd("expand-all-fp-mlx", cl::init(false), cl::Hidden);
static cl::opt<unsigned>
ExpandLimit("expand-limit", cl::init(~0U), cl::Hidden);
STATISTIC(NumExpand, "Number of fp MLA / MLS instructions expanded");
namespace {
struct MLxExpansion : public MachineFunctionPass { … };
char MLxExpansion::ID = …;
}
void MLxExpansion::clearStack() { … }
void MLxExpansion::pushStack(MachineInstr *MI) { … }
MachineInstr *MLxExpansion::getAccDefMI(MachineInstr *MI) const { … }
unsigned MLxExpansion::getDefReg(MachineInstr *MI) const { … }
bool MLxExpansion::hasLoopHazard(MachineInstr *MI) const { … }
bool MLxExpansion::hasRAWHazard(unsigned Reg, MachineInstr *MI) const { … }
static bool isFpMulInstruction(unsigned Opcode) { … }
bool MLxExpansion::FindMLxHazard(MachineInstr *MI) { … }
void
MLxExpansion::ExpandFPMLxInstruction(MachineBasicBlock &MBB, MachineInstr *MI,
unsigned MulOpc, unsigned AddSubOpc,
bool NegAcc, bool HasLane) { … }
bool MLxExpansion::ExpandFPMLxInstructions(MachineBasicBlock &MBB) { … }
bool MLxExpansion::runOnMachineFunction(MachineFunction &Fn) { … }
FunctionPass *llvm::createMLxExpansionPass() { … }