#include "llvm/CodeGen/MachineVerifier.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/CodeGenCommonISel.h"
#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRangeCalc.h"
#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineConvergenceVerifier.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBundle.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/RegisterBank.h"
#include "llvm/CodeGen/RegisterBankInfo.h"
#include "llvm/CodeGen/SlotIndexes.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGenTypes/LowLevelType.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/EHPersonalities.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/InitializePasses.h"
#include "llvm/MC/LaneBitmask.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCTargetOptions.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/ModRef.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <string>
#include <utility>
usingnamespacellvm;
namespace {
struct MachineVerifier { … };
struct MachineVerifierLegacyPass : public MachineFunctionPass { … };
}
PreservedAnalyses
MachineVerifierPass::run(MachineFunction &MF,
MachineFunctionAnalysisManager &MFAM) { … }
char MachineVerifierLegacyPass::ID = …;
INITIALIZE_PASS(…)
FunctionPass *llvm::createMachineVerifierPass(const std::string &Banner) { … }
void llvm::verifyMachineFunction(const std::string &Banner,
const MachineFunction &MF) { … }
bool MachineFunction::verify(Pass *p, const char *Banner, raw_ostream *OS,
bool AbortOnErrors) const { … }
bool MachineFunction::verify(LiveIntervals *LiveInts, SlotIndexes *Indexes,
const char *Banner, raw_ostream *OS,
bool AbortOnErrors) const { … }
void MachineVerifier::verifySlotIndexes() const { … }
void MachineVerifier::verifyProperties(const MachineFunction &MF) { … }
unsigned MachineVerifier::verify(const MachineFunction &MF) { … }
void MachineVerifier::report(const char *msg, const MachineFunction *MF) { … }
void MachineVerifier::report(const char *msg, const MachineBasicBlock *MBB) { … }
void MachineVerifier::report(const char *msg, const MachineInstr *MI) { … }
void MachineVerifier::report(const char *msg, const MachineOperand *MO,
unsigned MONum, LLT MOVRegType) { … }
void MachineVerifier::report(const Twine &Msg, const MachineInstr *MI) { … }
void MachineVerifier::report_context(SlotIndex Pos) const { … }
void MachineVerifier::report_context(const LiveInterval &LI) const { … }
void MachineVerifier::report_context(const LiveRange &LR, Register VRegUnit,
LaneBitmask LaneMask) const { … }
void MachineVerifier::report_context(const LiveRange::Segment &S) const { … }
void MachineVerifier::report_context(const VNInfo &VNI) const { … }
void MachineVerifier::report_context_liverange(const LiveRange &LR) const { … }
void MachineVerifier::report_context(MCPhysReg PReg) const { … }
void MachineVerifier::report_context_vreg(Register VReg) const { … }
void MachineVerifier::report_context_vreg_regunit(Register VRegOrUnit) const { … }
void MachineVerifier::report_context_lanemask(LaneBitmask LaneMask) const { … }
void MachineVerifier::markReachable(const MachineBasicBlock *MBB) { … }
void MachineVerifier::visitMachineFunctionBefore() { … }
void
MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) { … }
void MachineVerifier::visitMachineBundleBefore(const MachineInstr *MI) { … }
void MachineVerifier::verifyInlineAsm(const MachineInstr *MI) { … }
bool MachineVerifier::verifyAllRegOpsScalar(const MachineInstr &MI,
const MachineRegisterInfo &MRI) { … }
bool MachineVerifier::verifyVectorElementMatch(LLT Ty0, LLT Ty1,
const MachineInstr *MI) { … }
bool MachineVerifier::verifyGIntrinsicSideEffects(const MachineInstr *MI) { … }
bool MachineVerifier::verifyGIntrinsicConvergence(const MachineInstr *MI) { … }
void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) { … }
void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { … }
void
MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { … }
void MachineVerifier::checkLivenessAtUse(const MachineOperand *MO,
unsigned MONum, SlotIndex UseIdx,
const LiveRange &LR,
Register VRegOrUnit,
LaneBitmask LaneMask) { … }
void MachineVerifier::checkLivenessAtDef(const MachineOperand *MO,
unsigned MONum, SlotIndex DefIdx,
const LiveRange &LR,
Register VRegOrUnit,
bool SubRangeCheck,
LaneBitmask LaneMask) { … }
void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) { … }
void MachineVerifier::visitMachineBundleAfter(const MachineInstr *MI) { … }
void
MachineVerifier::visitMachineBasicBlockAfter(const MachineBasicBlock *MBB) { … }
namespace {
struct VRegFilter { … };
class FilteringVRegSet { … };
}
void MachineVerifier::calcRegsPassed() { … }
void MachineVerifier::calcRegsRequired() { … }
void MachineVerifier::checkPHIOps(const MachineBasicBlock &MBB) { … }
static void
verifyConvergenceControl(const MachineFunction &MF, MachineDominatorTree &DT,
std::function<void(const Twine &Message)> FailureCB,
raw_ostream &OS) { … }
void MachineVerifier::visitMachineFunctionAfter() { … }
void MachineVerifier::verifyLiveVariables() { … }
void MachineVerifier::verifyLiveIntervals() { … }
void MachineVerifier::verifyLiveRangeValue(const LiveRange &LR,
const VNInfo *VNI, Register Reg,
LaneBitmask LaneMask) { … }
void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR,
const LiveRange::const_iterator I,
Register Reg,
LaneBitmask LaneMask) { … }
void MachineVerifier::verifyLiveRange(const LiveRange &LR, Register Reg,
LaneBitmask LaneMask) { … }
void MachineVerifier::verifyLiveInterval(const LiveInterval &LI) { … }
namespace {
struct StackStateOfBB { … };
}
void MachineVerifier::verifyStackFrame() { … }