Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
HexagonBitTracker.h
Go to the documentation of this file.
1//===- HexagonBitTracker.h --------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
10#define LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
11
12#include "BitTracker.h"
13#include "llvm/ADT/DenseMap.h"
14
15namespace llvm {
16
20class MachineFunction;
21class MachineInstr;
23
29
31 const HexagonInstrInfo &tii, MachineFunction &mf);
32
33 bool evaluate(const MachineInstr &MI, const CellMapType &Inputs,
34 CellMapType &Outputs) const override;
35 bool evaluate(const MachineInstr &BI, const CellMapType &Inputs,
36 BranchTargetList &Targets, bool &FallsThru) const override;
37
38 BitTracker::BitMask mask(Register Reg, unsigned Sub) const override;
39
41
43 const TargetRegisterClass &RC, unsigned Idx) const override;
44
48
49private:
50 unsigned getUniqueDefVReg(const MachineInstr &MI) const;
51 bool evaluateLoad(const MachineInstr &MI, const CellMapType &Inputs,
52 CellMapType &Outputs) const;
53 bool evaluateFormalCopy(const MachineInstr &MI, const CellMapType &Inputs,
54 CellMapType &Outputs) const;
55
56 unsigned getNextPhysReg(unsigned PReg, unsigned Width) const;
57 unsigned getVirtRegFor(unsigned PReg) const;
58
59 // Type of formal parameter extension.
60 struct ExtType {
61 enum { SExt, ZExt };
62
63 ExtType() = default;
64 ExtType(char t, uint16_t w) : Type(t), Width(w) {}
65
66 char Type = 0;
67 uint16_t Width = 0;
68 };
69 // Map VR -> extension type.
70 using RegExtMap = DenseMap<unsigned, ExtType>;
71 RegExtMap VRX;
72};
73
74} // end namespace llvm
75
76#endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONBITTRACKER_H
This file defines the DenseMap class.
IRTranslator LLVM IR MI
Register Reg
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:33
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Representation of each machine instruction.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Wrapper class representing virtual and physical registers.
Definition Register.h:19
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
This is an optimization pass for GlobalISel generic memory operations.
@ Sub
Subtraction of integers.
SetVector< const MachineBasicBlock * > BranchTargetList
Definition BitTracker.h:40
std::map< unsigned, RegisterCell > CellMapType
Definition BitTracker.h:41
BitTracker::BitMask mask(Register Reg, unsigned Sub) const override
uint16_t getPhysRegBitWidth(MCRegister Reg) const override
BitTracker::BranchTargetList BranchTargetList
bool evaluate(const MachineInstr &MI, const CellMapType &Inputs, CellMapType &Outputs) const override
HexagonEvaluator(const HexagonRegisterInfo &tri, MachineRegisterInfo &mri, const HexagonInstrInfo &tii, MachineFunction &mf)
MachineFrameInfo & MFI
BitTracker::RegisterCell RegisterCell
const HexagonInstrInfo & TII
const TargetRegisterClass & composeWithSubRegIndex(const TargetRegisterClass &RC, unsigned Idx) const override
BitTracker::CellMapType CellMapType
BitTracker::RegisterRef RegisterRef