1 //===--- HexagonBitTracker.h ------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
11 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
13 #include "BitTracker.h"
14 #include "llvm/ADT/DenseMap.h"
19 class HexagonInstrInfo;
20 class HexagonRegisterInfo;
22 struct HexagonEvaluator : public BitTracker::MachineEvaluator {
23 typedef BitTracker::CellMapType CellMapType;
24 typedef BitTracker::RegisterRef RegisterRef;
25 typedef BitTracker::RegisterCell RegisterCell;
26 typedef BitTracker::BranchTargetList BranchTargetList;
28 HexagonEvaluator(const HexagonRegisterInfo &tri, MachineRegisterInfo &mri,
29 const HexagonInstrInfo &tii, MachineFunction &mf);
31 bool evaluate(const MachineInstr &MI, const CellMapType &Inputs,
32 CellMapType &Outputs) const override;
33 bool evaluate(const MachineInstr &BI, const CellMapType &Inputs,
34 BranchTargetList &Targets, bool &FallsThru) const override;
36 BitTracker::BitMask mask(unsigned Reg, unsigned Sub) const override;
39 MachineFrameInfo &MFI;
40 const HexagonInstrInfo &TII;
43 bool evaluateLoad(const MachineInstr &MI, const CellMapType &Inputs,
44 CellMapType &Outputs) const;
45 bool evaluateFormalCopy(const MachineInstr &MI, const CellMapType &Inputs,
46 CellMapType &Outputs) const;
48 unsigned getNextPhysReg(unsigned PReg, unsigned Width) const;
49 unsigned getVirtRegFor(unsigned PReg) const;
51 // Type of formal parameter extension.
56 ExtType(char t, uint16_t w) : Type(t), Width(w) {}
61 // Map VR -> extension type.
62 typedef DenseMap<unsigned, ExtType> RegExtMap;
66 } // end namespace llvm
68 #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H