#include "AArch64.h"
#include "AArch64TargetMachine.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/GlobalISel/Utils.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#define DEBUG_TYPE …
usingnamespacellvm;
namespace {
class AArch64PostSelectOptimize : public MachineFunctionPass { … };
}
void AArch64PostSelectOptimize::getAnalysisUsage(AnalysisUsage &AU) const { … }
AArch64PostSelectOptimize::AArch64PostSelectOptimize()
: … { … }
unsigned getNonFlagSettingVariant(unsigned Opc) { … }
bool AArch64PostSelectOptimize::doPeepholeOpts(MachineBasicBlock &MBB) { … }
bool AArch64PostSelectOptimize::foldSimpleCrossClassCopies(MachineInstr &MI) { … }
bool AArch64PostSelectOptimize::foldCopyDup(MachineInstr &MI) { … }
bool AArch64PostSelectOptimize::optimizeNZCVDefs(MachineBasicBlock &MBB) { … }
bool AArch64PostSelectOptimize::runOnMachineFunction(MachineFunction &MF) { … }
char AArch64PostSelectOptimize::ID = …;
INITIALIZE_PASS_BEGIN(AArch64PostSelectOptimize, DEBUG_TYPE,
"Optimize AArch64 selected instructions",
false, false)
INITIALIZE_PASS_END(AArch64PostSelectOptimize, DEBUG_TYPE,
"Optimize AArch64 selected instructions", false,
false)
namespace llvm {
FunctionPass *createAArch64PostSelectOptimize() { … }
}