LLVM  8.0.1
HexagonBitTracker.h
Go to the documentation of this file.
1 //===- HexagonBitTracker.h --------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
11 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
12 
13 #include "BitTracker.h"
14 #include "llvm/ADT/DenseMap.h"
15 #include <cstdint>
16 
17 namespace llvm {
18 
19 class HexagonInstrInfo;
20 class HexagonRegisterInfo;
21 class MachineFrameInfo;
22 class MachineFunction;
23 class MachineInstr;
24 class MachineRegisterInfo;
25 
31 
33  const HexagonInstrInfo &tii, MachineFunction &mf);
34 
35  bool evaluate(const MachineInstr &MI, const CellMapType &Inputs,
36  CellMapType &Outputs) const override;
37  bool evaluate(const MachineInstr &BI, const CellMapType &Inputs,
38  BranchTargetList &Targets, bool &FallsThru) const override;
39 
40  BitTracker::BitMask mask(unsigned Reg, unsigned Sub) const override;
41 
42  uint16_t getPhysRegBitWidth(unsigned Reg) const override;
43 
45  const TargetRegisterClass &RC, unsigned Idx) const override;
46 
50 
51 private:
52  unsigned getUniqueDefVReg(const MachineInstr &MI) const;
53  bool evaluateLoad(const MachineInstr &MI, const CellMapType &Inputs,
54  CellMapType &Outputs) const;
55  bool evaluateFormalCopy(const MachineInstr &MI, const CellMapType &Inputs,
56  CellMapType &Outputs) const;
57 
58  unsigned getNextPhysReg(unsigned PReg, unsigned Width) const;
59  unsigned getVirtRegFor(unsigned PReg) const;
60 
61  // Type of formal parameter extension.
62  struct ExtType {
63  enum { SExt, ZExt };
64 
65  ExtType() = default;
66  ExtType(char t, uint16_t w) : Type(t), Width(w) {}
67 
68  char Type = 0;
69  uint16_t Width = 0;
70  };
71  // Map VR -> extension type.
73  RegExtMap VRX;
74 };
75 
76 } // end namespace llvm
77 
78 #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
unsigned Reg
BitTracker::BitMask mask(unsigned Reg, unsigned Sub) const override
MachineFrameInfo & MFI
const HexagonInstrInfo & TII
HexagonEvaluator(const HexagonRegisterInfo &tri, MachineRegisterInfo &mri, const HexagonInstrInfo &tii, MachineFunction &mf)
bool evaluate(const MachineInstr &MI, const CellMapType &Inputs, CellMapType &Outputs) const override
SetVector< const MachineBasicBlock * > BranchTargetList
Definition: BitTracker.h:44
BitTracker::CellMapType CellMapType
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
const TargetRegisterClass & composeWithSubRegIndex(const TargetRegisterClass &RC, unsigned Idx) const override
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
uint16_t getPhysRegBitWidth(unsigned Reg) const override
std::map< unsigned, RegisterCell > CellMapType
Definition: BitTracker.h:45
MachineFunction & MF
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
Definition: MachineInstr.h:64
A vector that has set insertion semantics.
Definition: SetVector.h:41
IRTranslator LLVM IR MI