2015-07-07 17:16:42 +02:00
|
|
|
//===--- HexagonBitTracker.h ----------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef HEXAGONBITTRACKER_H
|
|
|
|
#define HEXAGONBITTRACKER_H
|
|
|
|
|
|
|
|
#include "BitTracker.h"
|
|
|
|
#include "llvm/ADT/DenseMap.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class HexagonInstrInfo;
|
|
|
|
class HexagonRegisterInfo;
|
|
|
|
|
|
|
|
struct HexagonEvaluator : public BitTracker::MachineEvaluator {
|
|
|
|
typedef BitTracker::CellMapType CellMapType;
|
|
|
|
typedef BitTracker::RegisterRef RegisterRef;
|
|
|
|
typedef BitTracker::RegisterCell RegisterCell;
|
|
|
|
typedef BitTracker::BranchTargetList BranchTargetList;
|
|
|
|
|
2015-07-13 22:38:16 +02:00
|
|
|
HexagonEvaluator(const HexagonRegisterInfo &tri, MachineRegisterInfo &mri,
|
|
|
|
const HexagonInstrInfo &tii, MachineFunction &mf);
|
2015-07-07 17:16:42 +02:00
|
|
|
|
2016-07-12 03:55:32 +02:00
|
|
|
bool evaluate(const MachineInstr &MI, const CellMapType &Inputs,
|
2015-07-13 22:38:16 +02:00
|
|
|
CellMapType &Outputs) const override;
|
2016-07-12 03:55:32 +02:00
|
|
|
bool evaluate(const MachineInstr &BI, const CellMapType &Inputs,
|
2015-07-13 22:38:16 +02:00
|
|
|
BranchTargetList &Targets, bool &FallsThru) const override;
|
2015-07-07 17:16:42 +02:00
|
|
|
|
2015-07-13 22:38:16 +02:00
|
|
|
BitTracker::BitMask mask(unsigned Reg, unsigned Sub) const override;
|
2015-07-07 17:16:42 +02:00
|
|
|
|
2015-07-13 22:38:16 +02:00
|
|
|
MachineFunction &MF;
|
|
|
|
MachineFrameInfo &MFI;
|
|
|
|
const HexagonInstrInfo &TII;
|
2015-07-07 17:16:42 +02:00
|
|
|
|
|
|
|
private:
|
2016-07-12 03:55:32 +02:00
|
|
|
bool evaluateLoad(const MachineInstr &MI, const CellMapType &Inputs,
|
2015-07-13 22:38:16 +02:00
|
|
|
CellMapType &Outputs) const;
|
2016-07-12 03:55:32 +02:00
|
|
|
bool evaluateFormalCopy(const MachineInstr &MI, const CellMapType &Inputs,
|
2015-07-13 22:38:16 +02:00
|
|
|
CellMapType &Outputs) const;
|
2015-07-07 17:16:42 +02:00
|
|
|
|
|
|
|
unsigned getNextPhysReg(unsigned PReg, unsigned Width) const;
|
|
|
|
unsigned getVirtRegFor(unsigned PReg) const;
|
|
|
|
|
|
|
|
// Type of formal parameter extension.
|
|
|
|
struct ExtType {
|
|
|
|
enum { SExt, ZExt };
|
|
|
|
char Type;
|
|
|
|
uint16_t Width;
|
|
|
|
ExtType() : Type(0), Width(0) {}
|
|
|
|
ExtType(char t, uint16_t w) : Type(t), Width(w) {}
|
|
|
|
};
|
|
|
|
// Map VR -> extension type.
|
2015-07-13 22:38:16 +02:00
|
|
|
typedef DenseMap<unsigned, ExtType> RegExtMap;
|
2015-07-07 17:16:42 +02:00
|
|
|
RegExtMap VRX;
|
|
|
|
};
|
|
|
|
|
2015-07-13 22:38:16 +02:00
|
|
|
} // end namespace llvm
|
2015-07-07 17:16:42 +02:00
|
|
|
|
2015-07-13 22:38:16 +02:00
|
|
|
#endif
|