#include "LoongArch.h"
#include "LoongArchInstrInfo.h"
#include "LoongArchTargetMachine.h"
#include "MCTargetDesc/LoongArchBaseInfo.h"
#include "MCTargetDesc/LoongArchMCTargetDesc.h"
#include "llvm/CodeGen/LivePhysRegs.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/Register.h"
#include "llvm/MC/MCContext.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/ErrorHandling.h"
usingnamespacellvm;
#define LOONGARCH_PRERA_EXPAND_PSEUDO_NAME …
#define LOONGARCH_EXPAND_PSEUDO_NAME …
namespace {
class LoongArchPreRAExpandPseudo : public MachineFunctionPass { … };
char LoongArchPreRAExpandPseudo::ID = …;
bool LoongArchPreRAExpandPseudo::runOnMachineFunction(MachineFunction &MF) { … }
bool LoongArchPreRAExpandPseudo::expandMBB(MachineBasicBlock &MBB) { … }
bool LoongArchPreRAExpandPseudo::expandMI(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI) { … }
bool LoongArchPreRAExpandPseudo::expandPcalau12iInstPair(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, unsigned FlagsHi,
unsigned SecondOpcode, unsigned FlagsLo) { … }
bool LoongArchPreRAExpandPseudo::expandLargeAddressLoad(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, unsigned LastOpcode,
unsigned IdentifyingMO) { … }
bool LoongArchPreRAExpandPseudo::expandLargeAddressLoad(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, unsigned LastOpcode,
unsigned IdentifyingMO, const MachineOperand &Symbol, Register DestReg,
bool EraseFromParent) { … }
bool LoongArchPreRAExpandPseudo::expandLoadAddressPcrel(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, bool Large) { … }
bool LoongArchPreRAExpandPseudo::expandLoadAddressGot(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, bool Large) { … }
bool LoongArchPreRAExpandPseudo::expandLoadAddressTLSLE(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI) { … }
bool LoongArchPreRAExpandPseudo::expandLoadAddressTLSIE(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, bool Large) { … }
bool LoongArchPreRAExpandPseudo::expandLoadAddressTLSLD(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, bool Large) { … }
bool LoongArchPreRAExpandPseudo::expandLoadAddressTLSGD(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, bool Large) { … }
bool LoongArchPreRAExpandPseudo::expandLoadAddressTLSDesc(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, bool Large) { … }
bool LoongArchPreRAExpandPseudo::expandFunctionCALL(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI, bool IsTailCall) { … }
class LoongArchExpandPseudo : public MachineFunctionPass { … };
char LoongArchExpandPseudo::ID = …;
bool LoongArchExpandPseudo::runOnMachineFunction(MachineFunction &MF) { … }
bool LoongArchExpandPseudo::expandMBB(MachineBasicBlock &MBB) { … }
bool LoongArchExpandPseudo::expandMI(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI) { … }
bool LoongArchExpandPseudo::expandCopyCFR(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
MachineBasicBlock::iterator &NextMBBI) { … }
}
INITIALIZE_PASS(…)
INITIALIZE_PASS(…)
namespace llvm {
FunctionPass *createLoongArchPreRAExpandPseudoPass() { … }
FunctionPass *createLoongArchExpandPseudoPass() { … }
}