#include "HexagonInstrInfo.h"
#include "HexagonRegisterInfo.h"
#include "HexagonSubtarget.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/LiveRegUnits.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
#include <iterator>
#include <limits>
#include <utility>
#define DEBUG_TYPE …
usingnamespacellvm;
namespace llvm {
FunctionPass *createHexagonGenMux();
void initializeHexagonGenMuxPass(PassRegistry& Registry);
}
static cl::opt<unsigned> MinPredDist("hexagon-gen-mux-threshold", cl::Hidden,
cl::init(0), cl::desc("Minimum distance between predicate definition and "
"farther of the two predicated uses"));
namespace {
class HexagonGenMux : public MachineFunctionPass { … };
}
char HexagonGenMux::ID = …;
INITIALIZE_PASS(…)
void HexagonGenMux::getSubRegs(unsigned Reg, BitVector &SRs) const { … }
void HexagonGenMux::expandReg(unsigned Reg, BitVector &Set) const { … }
void HexagonGenMux::getDefsUses(const MachineInstr *MI, BitVector &Defs,
BitVector &Uses) const { … }
void HexagonGenMux::buildMaps(MachineBasicBlock &B, InstrIndexMap &I2X,
DefUseInfoMap &DUM) { … }
bool HexagonGenMux::isCondTransfer(unsigned Opc) const { … }
unsigned HexagonGenMux::getMuxOpcode(const MachineOperand &Src1,
const MachineOperand &Src2) const { … }
bool HexagonGenMux::genMuxInBlock(MachineBasicBlock &B) { … }
bool HexagonGenMux::runOnMachineFunction(MachineFunction &MF) { … }
FunctionPass *llvm::createHexagonGenMux() { … }