LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/BPF - BPFGenSubtargetInfo.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 12 20 60.0 %
Date: 2018-10-20 13:21:21 Functions: 3 7 42.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
       2             : |*                                                                            *|
       3             : |* Subtarget Enumeration Source Fragment                                      *|
       4             : |*                                                                            *|
       5             : |* Automatically generated file, do not edit!                                 *|
       6             : |*                                                                            *|
       7             : \*===----------------------------------------------------------------------===*/
       8             : 
       9             : 
      10             : #ifdef GET_SUBTARGETINFO_ENUM
      11             : #undef GET_SUBTARGETINFO_ENUM
      12             : 
      13             : namespace llvm {
      14             : namespace BPF {
      15             : enum {
      16             :   ALU32 = 0,
      17             :   DummyFeature = 1,
      18             :   DwarfRIS = 2,
      19             : };
      20             : } // end namespace BPF
      21             : } // end namespace llvm
      22             : 
      23             : #endif // GET_SUBTARGETINFO_ENUM
      24             : 
      25             : 
      26             : #ifdef GET_SUBTARGETINFO_MC_DESC
      27             : #undef GET_SUBTARGETINFO_MC_DESC
      28             : 
      29             : namespace llvm {
      30             : // Sorted (by key) array of values for CPU features.
      31             : extern const llvm::SubtargetFeatureKV BPFFeatureKV[] = {
      32             :   { "alu32", "Enable ALU32 instructions", { BPF::ALU32 }, { } },
      33             :   { "dummy", "unused feature", { BPF::DummyFeature }, { } },
      34             :   { "dwarfris", "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections", { BPF::DwarfRIS }, { } },
      35             : };
      36             : 
      37             : // Sorted (by key) array of values for CPU subtype.
      38             : extern const llvm::SubtargetFeatureKV BPFSubTypeKV[] = {
      39             :   { "generic", "Select the generic processor", { }, { } },
      40             :   { "probe", "Select the probe processor", { }, { } },
      41             :   { "v1", "Select the v1 processor", { }, { } },
      42             :   { "v2", "Select the v2 processor", { }, { } },
      43             : };
      44             : 
      45             : #ifdef DBGFIELD
      46             : #error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro"
      47             : #endif
      48             : #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
      49             : #define DBGFIELD(x) x,
      50             : #else
      51             : #define DBGFIELD(x)
      52             : #endif
      53             : 
      54             : // ===============================================================
      55             : // Data tables for the new per-operand machine model.
      56             : 
      57             : // {ProcResourceIdx, Cycles}
      58             : extern const llvm::MCWriteProcResEntry BPFWriteProcResTable[] = {
      59             :   { 0,  0}, // Invalid
      60             : }; // BPFWriteProcResTable
      61             : 
      62             : // {Cycles, WriteResourceID}
      63             : extern const llvm::MCWriteLatencyEntry BPFWriteLatencyTable[] = {
      64             :   { 0,  0}, // Invalid
      65             : }; // BPFWriteLatencyTable
      66             : 
      67             : // {UseIdx, WriteResourceID, Cycles}
      68             : extern const llvm::MCReadAdvanceEntry BPFReadAdvanceTable[] = {
      69             :   {0,  0,  0}, // Invalid
      70             : }; // BPFReadAdvanceTable
      71             : 
      72             : static const llvm::MCSchedModel NoSchedModel = {
      73             :   MCSchedModel::DefaultIssueWidth,
      74             :   MCSchedModel::DefaultMicroOpBufferSize,
      75             :   MCSchedModel::DefaultLoopMicroOpBufferSize,
      76             :   MCSchedModel::DefaultLoadLatency,
      77             :   MCSchedModel::DefaultHighLatency,
      78             :   MCSchedModel::DefaultMispredictPenalty,
      79             :   false, // PostRAScheduler
      80             :   false, // CompleteModel
      81             :   0, // Processor ID
      82             :   nullptr, nullptr, 0, 0, // No instruction-level machine model.
      83             :   nullptr, // No Itinerary
      84             :   nullptr // No extra processor descriptor
      85             : };
      86             : 
      87             : // Sorted (by key) array of itineraries for CPU subtype.
      88             : extern const llvm::SubtargetInfoKV BPFProcSchedKV[] = {
      89             :   { "generic", (const void *)&NoSchedModel },
      90             :   { "probe", (const void *)&NoSchedModel },
      91             :   { "v1", (const void *)&NoSchedModel },
      92             :   { "v2", (const void *)&NoSchedModel },
      93             : };
      94             : 
      95             : #undef DBGFIELD
      96             : namespace BPF_MC {
      97           0 : unsigned resolveVariantSchedClassImpl(unsigned SchedClass,
      98             :     const MCInst *MI, unsigned CPUID) {
      99             :   // Don't know how to resolve this scheduling class.
     100           0 :   return 0;
     101             : }
     102             : } // end of namespace BPF_MC
     103             : 
     104             : struct BPFGenMCSubtargetInfo : public MCSubtargetInfo {
     105             :   BPFGenMCSubtargetInfo(const Triple &TT, 
     106             :     StringRef CPU, StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
     107             :     ArrayRef<SubtargetFeatureKV> PD,
     108             :     const SubtargetInfoKV *ProcSched,
     109             :     const MCWriteProcResEntry *WPR,
     110             :     const MCWriteLatencyEntry *WL,
     111             :     const MCReadAdvanceEntry *RA, const InstrStage *IS,
     112          86 :     const unsigned *OC, const unsigned *FP) :
     113             :       MCSubtargetInfo(TT, CPU, FS, PF, PD, ProcSched,
     114          86 :                       WPR, WL, RA, IS, OC, FP) { }
     115             : 
     116           0 :   unsigned resolveVariantSchedClass(unsigned SchedClass,
     117             :       const MCInst *MI, unsigned CPUID) const override {
     118           0 :     return BPF_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID); 
     119             :   }
     120             : };
     121             : 
     122          86 : static inline MCSubtargetInfo *createBPFMCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) {
     123             :   return new BPFGenMCSubtargetInfo(TT, CPU, FS, BPFFeatureKV, BPFSubTypeKV, 
     124             :                       BPFProcSchedKV, BPFWriteProcResTable, BPFWriteLatencyTable, BPFReadAdvanceTable, 
     125          86 :                       nullptr, nullptr, nullptr);
     126             : }
     127             : 
     128             : } // end namespace llvm
     129             : 
     130             : #endif // GET_SUBTARGETINFO_MC_DESC
     131             : 
     132             : 
     133             : #ifdef GET_SUBTARGETINFO_TARGET_DESC
     134             : #undef GET_SUBTARGETINFO_TARGET_DESC
     135             : 
     136             : #include "llvm/Support/Debug.h"
     137             : #include "llvm/Support/raw_ostream.h"
     138             : 
     139             : // ParseSubtargetFeatures - Parses features string setting specified
     140             : // subtarget options.
     141          69 : void llvm::BPFSubtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) {
     142             :   LLVM_DEBUG(dbgs() << "\nFeatures:" << FS);
     143             :   LLVM_DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n");
     144          69 :   InitMCProcessorInfo(CPU, FS);
     145             :   const FeatureBitset& Bits = getFeatureBits();
     146          69 :   if (Bits[BPF::ALU32]) HasAlu32 = true;
     147          69 :   if (Bits[BPF::DummyFeature]) isDummyMode = true;
     148          69 :   if (Bits[BPF::DwarfRIS]) UseDwarfRIS = true;
     149          69 : }
     150             : #endif // GET_SUBTARGETINFO_TARGET_DESC
     151             : 
     152             : 
     153             : #ifdef GET_SUBTARGETINFO_HEADER
     154             : #undef GET_SUBTARGETINFO_HEADER
     155             : 
     156             : namespace llvm {
     157             : class DFAPacketizer;
     158             : namespace BPF_MC {
     159             : unsigned resolveVariantSchedClassImpl(unsigned SchedClass, const MCInst *MI, unsigned CPUID);
     160             : }
     161             : 
     162             : struct BPFGenSubtargetInfo : public TargetSubtargetInfo {
     163             :   explicit BPFGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS);
     164             : public:
     165             :   unsigned resolveSchedClass(unsigned SchedClass,  const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override;
     166             :   unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const override;
     167             :   DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
     168             : };
     169             : } // end namespace llvm
     170             : 
     171             : #endif // GET_SUBTARGETINFO_HEADER
     172             : 
     173             : 
     174             : #ifdef GET_SUBTARGETINFO_CTOR
     175             : #undef GET_SUBTARGETINFO_CTOR
     176             : 
     177             : #include "llvm/CodeGen/TargetSchedule.h"
     178             : 
     179             : namespace llvm {
     180             : extern const llvm::SubtargetFeatureKV BPFFeatureKV[];
     181             : extern const llvm::SubtargetFeatureKV BPFSubTypeKV[];
     182             : extern const llvm::SubtargetInfoKV BPFProcSchedKV[];
     183             : extern const llvm::MCWriteProcResEntry BPFWriteProcResTable[];
     184             : extern const llvm::MCWriteLatencyEntry BPFWriteLatencyTable[];
     185             : extern const llvm::MCReadAdvanceEntry BPFReadAdvanceTable[];
     186          69 : BPFGenSubtargetInfo::BPFGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
     187             :   : TargetSubtargetInfo(TT, CPU, FS, makeArrayRef(BPFFeatureKV, 3), makeArrayRef(BPFSubTypeKV, 4), 
     188             :                         BPFProcSchedKV, BPFWriteProcResTable, BPFWriteLatencyTable, BPFReadAdvanceTable, 
     189          69 :                         nullptr, nullptr, nullptr) {}
     190             : 
     191           0 : unsigned BPFGenSubtargetInfo
     192             : ::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
     193           0 :   report_fatal_error("Expected a variant SchedClass");
     194             : } // BPFGenSubtargetInfo::resolveSchedClass
     195             : 
     196           0 : unsigned BPFGenSubtargetInfo
     197             : ::resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const {
     198           0 :   return BPF_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID);
     199             : } // BPFGenSubtargetInfo::resolveVariantSchedClass
     200             : 
     201             : } // end namespace llvm
     202             : 
     203             : #endif // GET_SUBTARGETINFO_CTOR
     204             : 
     205             : 
     206             : #ifdef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
     207             : #undef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
     208             : 
     209             : #endif // GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
     210             : 
     211             : 
     212             : #ifdef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
     213             : #undef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
     214             : 
     215             : #endif // GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
     216             : 

Generated by: LCOV version 1.13