LCOV - code coverage report
Current view: top level - lib/Target/AMDGPU - AMDGPUMachineFunction.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 15 15 100.0 %
Date: 2017-09-14 15:23:50 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- AMDGPUMachineFunctionInfo.cpp ---------------------------------------=//
       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             : #include "AMDGPUMachineFunction.h"
      11             : #include "AMDGPUSubtarget.h"
      12             : 
      13             : using namespace llvm;
      14             : 
      15       17166 : AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
      16             :   MachineFunctionInfo(),
      17             :   LocalMemoryObjects(),
      18             :   KernArgSize(0),
      19             :   MaxKernArgAlign(0),
      20             :   LDSSize(0),
      21             :   ABIArgOffset(0),
      22       34332 :   IsEntryFunction(AMDGPU::isEntryFunctionCC(MF.getFunction()->getCallingConv())),
      23       51498 :   NoSignedZerosFPMath(MF.getTarget().Options.NoSignedZerosFPMath) {
      24             :   // FIXME: Should initialize KernArgSize based on ExplicitKernelArgOffset,
      25             :   // except reserved size is not correctly aligned.
      26       17166 : }
      27             : 
      28         295 : unsigned AMDGPUMachineFunction::allocateLDSGlobal(const DataLayout &DL,
      29             :                                                   const GlobalValue &GV) {
      30        1180 :   auto Entry = LocalMemoryObjects.insert(std::make_pair(&GV, 0));
      31         295 :   if (!Entry.second)
      32           3 :     return Entry.first->second;
      33             : 
      34         292 :   unsigned Align = GV.getAlignment();
      35         292 :   if (Align == 0)
      36          41 :     Align = DL.getABITypeAlignment(GV.getValueType());
      37             : 
      38             :   /// TODO: We should sort these to minimize wasted space due to alignment
      39             :   /// padding. Currently the padding is decided by the first encountered use
      40             :   /// during lowering.
      41         584 :   unsigned Offset = LDSSize = alignTo(LDSSize, Align);
      42             : 
      43         292 :   Entry.first->second = Offset;
      44         292 :   LDSSize += DL.getTypeAllocSize(GV.getValueType());
      45             : 
      46         292 :   return Offset;
      47             : }

Generated by: LCOV version 1.13