LCOV - code coverage report
Current view: top level - include/llvm/CodeGen - SelectionDAGAddressAnalysis.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 4 4 100.0 %
Date: 2017-09-14 15:23:50 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- llvm/CodeGen/SelectionDAGAddressAnalysis.h  ------- DAG Address Analysis
       2             : //---*- C++ -*-===//
       3             : //
       4             : //                     The LLVM Compiler Infrastructure
       5             : //
       6             : // This file is distributed under the University of Illinois Open Source
       7             : // License. See LICENSE.TXT for details.
       8             : //
       9             : //===----------------------------------------------------------------------===//
      10             : //
      11             : 
      12             : #ifndef LLVM_CODEGEN_SELECTIONDAGADDRESSANALYSIS_H
      13             : #define LLVM_CODEGEN_SELECTIONDAGADDRESSANALYSIS_H
      14             : 
      15             : #include "llvm/CodeGen/ISDOpcodes.h"
      16             : #include "llvm/CodeGen/SelectionDAG.h"
      17             : #include "llvm/CodeGen/SelectionDAGNodes.h"
      18             : 
      19             : namespace llvm {
      20             : /// Helper struct to parse and store a memory address as base + index + offset.
      21             : /// We ignore sign extensions when it is safe to do so.
      22             : /// The following two expressions are not equivalent. To differentiate we need
      23             : /// to store whether there was a sign extension involved in the index
      24             : /// computation.
      25             : ///  (load (i64 add (i64 copyfromreg %c)
      26             : ///                 (i64 signextend (add (i8 load %index)
      27             : ///                                      (i8 1))))
      28             : /// vs
      29             : ///
      30             : /// (load (i64 add (i64 copyfromreg %c)
      31             : ///                (i64 signextend (i32 add (i32 signextend (i8 load %index))
      32             : ///                                         (i32 1)))))
      33             : class BaseIndexOffset {
      34             : private:
      35             :   SDValue Base;
      36             :   SDValue Index;
      37             :   int64_t Offset;
      38             :   bool IsIndexSignExt;
      39             : 
      40             : public:
      41     2389710 :   BaseIndexOffset() : Offset(0), IsIndexSignExt(false) {}
      42             : 
      43             :   BaseIndexOffset(SDValue Base, SDValue Index, int64_t Offset,
      44             :                   bool IsIndexSignExt)
      45    15222812 :       : Base(Base), Index(Index), Offset(Offset),
      46    15222812 :         IsIndexSignExt(IsIndexSignExt) {}
      47             : 
      48             :   SDValue getBase() { return Base; }
      49             :   SDValue getIndex() { return Index; }
      50             : 
      51             :   bool equalBaseIndex(BaseIndexOffset &Other, const SelectionDAG &DAG) {
      52             :     int64_t Off;
      53     2917102 :     return equalBaseIndex(Other, DAG, Off);
      54             :   }
      55             : 
      56             :   bool equalBaseIndex(BaseIndexOffset &Other, const SelectionDAG &DAG,
      57             :                       int64_t &Off);
      58             : 
      59             :   /// Parses tree in Ptr for base, index, offset addresses.
      60             :   static BaseIndexOffset match(SDValue Ptr, const SelectionDAG &DAG);
      61             : };
      62             : } // namespace llvm
      63             : 
      64             : #endif

Generated by: LCOV version 1.13