#include "BitTracker.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/IR/Constants.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <iterator>
usingnamespacellvm;
BT;
namespace {
struct printv { … };
raw_ostream &operator<< (raw_ostream &OS, const printv &PV) { … }
}
namespace llvm {
raw_ostream &operator<<(raw_ostream &OS, const BT::BitValue &BV) { … }
raw_ostream &operator<<(raw_ostream &OS, const BT::RegisterCell &RC) { … }
}
void BitTracker::print_cells(raw_ostream &OS) const { … }
BitTracker::BitTracker(const MachineEvaluator &E, MachineFunction &F)
: … { … }
BitTracker::~BitTracker() { … }
bool BT::RegisterCell::meet(const RegisterCell &RC, Register SelfR) { … }
BT::RegisterCell &BT::RegisterCell::insert(const BT::RegisterCell &RC,
const BitMask &M) { … }
BT::RegisterCell BT::RegisterCell::extract(const BitMask &M) const { … }
BT::RegisterCell &BT::RegisterCell::rol(uint16_t Sh) { … }
BT::RegisterCell &BT::RegisterCell::fill(uint16_t B, uint16_t E,
const BitValue &V) { … }
BT::RegisterCell &BT::RegisterCell::cat(const RegisterCell &RC) { … }
uint16_t BT::RegisterCell::ct(bool B) const { … }
uint16_t BT::RegisterCell::cl(bool B) const { … }
bool BT::RegisterCell::operator== (const RegisterCell &RC) const { … }
BT::RegisterCell &BT::RegisterCell::regify(unsigned R) { … }
uint16_t BT::MachineEvaluator::getRegBitWidth(const RegisterRef &RR) const { … }
BT::RegisterCell BT::MachineEvaluator::getCell(const RegisterRef &RR,
const CellMapType &M) const { … }
void BT::MachineEvaluator::putCell(const RegisterRef &RR, RegisterCell RC,
CellMapType &M) const { … }
bool BT::MachineEvaluator::isInt(const RegisterCell &A) const { … }
uint64_t BT::MachineEvaluator::toInt(const RegisterCell &A) const { … }
BT::RegisterCell BT::MachineEvaluator::eIMM(int64_t V, uint16_t W) const { … }
BT::RegisterCell BT::MachineEvaluator::eIMM(const ConstantInt *CI) const { … }
BT::RegisterCell BT::MachineEvaluator::eADD(const RegisterCell &A1,
const RegisterCell &A2) const { … }
BT::RegisterCell BT::MachineEvaluator::eSUB(const RegisterCell &A1,
const RegisterCell &A2) const { … }
BT::RegisterCell BT::MachineEvaluator::eMLS(const RegisterCell &A1,
const RegisterCell &A2) const { … }
BT::RegisterCell BT::MachineEvaluator::eMLU(const RegisterCell &A1,
const RegisterCell &A2) const { … }
BT::RegisterCell BT::MachineEvaluator::eASL(const RegisterCell &A1,
uint16_t Sh) const { … }
BT::RegisterCell BT::MachineEvaluator::eLSR(const RegisterCell &A1,
uint16_t Sh) const { … }
BT::RegisterCell BT::MachineEvaluator::eASR(const RegisterCell &A1,
uint16_t Sh) const { … }
BT::RegisterCell BT::MachineEvaluator::eAND(const RegisterCell &A1,
const RegisterCell &A2) const { … }
BT::RegisterCell BT::MachineEvaluator::eORL(const RegisterCell &A1,
const RegisterCell &A2) const { … }
BT::RegisterCell BT::MachineEvaluator::eXOR(const RegisterCell &A1,
const RegisterCell &A2) const { … }
BT::RegisterCell BT::MachineEvaluator::eNOT(const RegisterCell &A1) const { … }
BT::RegisterCell BT::MachineEvaluator::eSET(const RegisterCell &A1,
uint16_t BitN) const { … }
BT::RegisterCell BT::MachineEvaluator::eCLR(const RegisterCell &A1,
uint16_t BitN) const { … }
BT::RegisterCell BT::MachineEvaluator::eCLB(const RegisterCell &A1, bool B,
uint16_t W) const { … }
BT::RegisterCell BT::MachineEvaluator::eCTB(const RegisterCell &A1, bool B,
uint16_t W) const { … }
BT::RegisterCell BT::MachineEvaluator::eSXT(const RegisterCell &A1,
uint16_t FromN) const { … }
BT::RegisterCell BT::MachineEvaluator::eZXT(const RegisterCell &A1,
uint16_t FromN) const { … }
BT::RegisterCell BT::MachineEvaluator::eXTR(const RegisterCell &A1,
uint16_t B, uint16_t E) const { … }
BT::RegisterCell BT::MachineEvaluator::eINS(const RegisterCell &A1,
const RegisterCell &A2, uint16_t AtN) const { … }
BT::BitMask BT::MachineEvaluator::mask(Register Reg, unsigned Sub) const { … }
uint16_t BT::MachineEvaluator::getPhysRegBitWidth(MCRegister Reg) const { … }
bool BT::MachineEvaluator::evaluate(const MachineInstr &MI,
const CellMapType &Inputs,
CellMapType &Outputs) const { … }
bool BT::UseQueueType::Cmp::operator()(const MachineInstr *InstA,
const MachineInstr *InstB) const { … }
void BT::visitPHI(const MachineInstr &PI) { … }
void BT::visitNonBranch(const MachineInstr &MI) { … }
void BT::visitBranchesFrom(const MachineInstr &BI) { … }
void BT::visitUsesOf(Register Reg) { … }
BT::RegisterCell BT::get(RegisterRef RR) const { … }
void BT::put(RegisterRef RR, const RegisterCell &RC) { … }
void BT::subst(RegisterRef OldRR, RegisterRef NewRR) { … }
bool BT::reached(const MachineBasicBlock *B) const { … }
void BT::visit(const MachineInstr &MI) { … }
void BT::reset() { … }
void BT::runEdgeQueue(BitVector &BlockScanned) { … }
void BT::runUseQueue() { … }
void BT::run() { … }