LCOV - code coverage report
Current view: top level - lib/Target/AArch64 - AArch64RegisterInfo.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 6 6 100.0 %
Date: 2018-02-23 15:42:53 Functions: 3 5 60.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //==- AArch64RegisterInfo.h - AArch64 Register Information Impl --*- 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             : // This file contains the AArch64 implementation of the MRegisterInfo class.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64REGISTERINFO_H
      15             : #define LLVM_LIB_TARGET_AARCH64_AARCH64REGISTERINFO_H
      16             : 
      17             : #define GET_REGINFO_HEADER
      18             : #include "AArch64GenRegisterInfo.inc"
      19             : 
      20             : namespace llvm {
      21             : 
      22             : class MachineFunction;
      23             : class RegScavenger;
      24             : class TargetRegisterClass;
      25             : class Triple;
      26             : 
      27        1297 : class AArch64RegisterInfo final : public AArch64GenRegisterInfo {
      28             :   const Triple &TT;
      29             : 
      30             : public:
      31             :   AArch64RegisterInfo(const Triple &TT);
      32             : 
      33             :   bool isReservedReg(const MachineFunction &MF, unsigned Reg) const;
      34             : 
      35             :   /// Code Generation virtual methods...
      36             :   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
      37             :   const MCPhysReg *
      38             :   getCalleeSavedRegsViaCopy(const MachineFunction *MF) const;
      39             :   const uint32_t *getCallPreservedMask(const MachineFunction &MF,
      40             :                                        CallingConv::ID) const override;
      41             : 
      42       12659 :   unsigned getCSRFirstUseCost() const override {
      43             :     // The cost will be compared against BlockFrequency where entry has the
      44             :     // value of 1 << 14. A value of 5 will choose to spill or split really
      45             :     // cold path instead of using a callee-saved register.
      46       12659 :     return 5;
      47             :   }
      48             : 
      49             :   // Calls involved in thread-local variable lookup save more registers than
      50             :   // normal calls, so they need a different mask to represent this.
      51             :   const uint32_t *getTLSCallPreservedMask() const;
      52             : 
      53             :   /// getThisReturnPreservedMask - Returns a call preserved mask specific to the
      54             :   /// case that 'returned' is on an i64 first argument if the calling convention
      55             :   /// is one that can (partially) model this attribute with a preserved mask
      56             :   /// (i.e. it is a calling convention that uses the same register for the first
      57             :   /// i64 argument and an i64 return value)
      58             :   ///
      59             :   /// Should return NULL in the case that the calling convention does not have
      60             :   /// this property
      61             :   const uint32_t *getThisReturnPreservedMask(const MachineFunction &MF,
      62             :                                              CallingConv::ID) const;
      63             : 
      64             :   /// Stack probing calls preserve different CSRs to the normal CC.
      65             :   const uint32_t *getWindowsStackProbePreservedMask() const;
      66             : 
      67             :   BitVector getReservedRegs(const MachineFunction &MF) const override;
      68             :   bool isConstantPhysReg(unsigned PhysReg) const override;
      69             :   const TargetRegisterClass *
      70             :   getPointerRegClass(const MachineFunction &MF,
      71             :                      unsigned Kind = 0) const override;
      72             :   const TargetRegisterClass *
      73             :   getCrossCopyRegClass(const TargetRegisterClass *RC) const override;
      74             : 
      75      111915 :   bool enableMultipleCopyHints() const override { return true; }
      76             : 
      77             :   bool requiresRegisterScavenging(const MachineFunction &MF) const override;
      78             :   bool useFPForScavengingIndex(const MachineFunction &MF) const override;
      79             :   bool requiresFrameIndexScavenging(const MachineFunction &MF) const override;
      80             : 
      81             :   bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const override;
      82             :   bool isFrameOffsetLegal(const MachineInstr *MI, unsigned BaseReg,
      83             :                           int64_t Offset) const override;
      84             :   void materializeFrameBaseRegister(MachineBasicBlock *MBB, unsigned BaseReg,
      85             :                                     int FrameIdx,
      86             :                                     int64_t Offset) const override;
      87             :   void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
      88             :                          int64_t Offset) const override;
      89             :   void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
      90             :                            unsigned FIOperandNum,
      91             :                            RegScavenger *RS = nullptr) const override;
      92             :   bool cannotEliminateFrame(const MachineFunction &MF) const;
      93             : 
      94             :   bool requiresVirtualBaseRegisters(const MachineFunction &MF) const override;
      95             :   bool hasBasePointer(const MachineFunction &MF) const;
      96             :   unsigned getBaseRegister() const;
      97             : 
      98             :   // Debug information queries.
      99             :   unsigned getFrameRegister(const MachineFunction &MF) const override;
     100             : 
     101             :   unsigned getRegPressureLimit(const TargetRegisterClass *RC,
     102             :                                MachineFunction &MF) const override;
     103             : 
     104       26148 :   bool trackLivenessAfterRegAlloc(const MachineFunction&) const override {
     105       26148 :     return true;
     106             :   }
     107             : };
     108             : 
     109             : } // end namespace llvm
     110             : 
     111             : #endif

Generated by: LCOV version 1.13