LLVM  6.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::BaseIndexOffset Class Reference

Helper struct to parse and store a memory address as base + index + offset. More...

#include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"

Public Member Functions

 BaseIndexOffset ()=default
 
 BaseIndexOffset (SDValue Base, SDValue Index, int64_t Offset, bool IsIndexSignExt)
 
SDValue getBase ()
 
SDValue getIndex ()
 
bool equalBaseIndex (BaseIndexOffset &Other, const SelectionDAG &DAG)
 
bool equalBaseIndex (BaseIndexOffset &Other, const SelectionDAG &DAG, int64_t &Off)
 

Static Public Member Functions

static BaseIndexOffset match (SDValue Ptr, const SelectionDAG &DAG)
 Parses tree in Ptr for base, index, offset addresses. More...
 

Detailed Description

Helper struct to parse and store a memory address as base + index + offset.

We ignore sign extensions when it is safe to do so. The following two expressions are not equivalent. To differentiate we need to store whether there was a sign extension involved in the index computation. (load (i64 add (i64 copyfromreg c) (i64 signextend (add (i8 load index) (i8 1)))) vs

(load (i64 add (i64 copyfromreg c) (i64 signextend (i32 add (i32 signextend (i8 load index)) (i32 1)))))

Definition at line 33 of file SelectionDAGAddressAnalysis.h.

Constructor & Destructor Documentation

◆ BaseIndexOffset() [1/2]

llvm::BaseIndexOffset::BaseIndexOffset ( )
default

Referenced by match().

◆ BaseIndexOffset() [2/2]

llvm::BaseIndexOffset::BaseIndexOffset ( SDValue  Base,
SDValue  Index,
int64_t  Offset,
bool  IsIndexSignExt 
)
inline

Definition at line 42 of file SelectionDAGAddressAnalysis.h.

Member Function Documentation

◆ equalBaseIndex() [1/2]

bool llvm::BaseIndexOffset::equalBaseIndex ( BaseIndexOffset Other,
const SelectionDAG DAG 
)
inline

Definition at line 50 of file SelectionDAGAddressAnalysis.h.

References match(), and Other.

Referenced by calculateByteProvider(), findBaseOffset(), and peekThroughBitcast().

◆ equalBaseIndex() [2/2]

bool BaseIndexOffset::equalBaseIndex ( BaseIndexOffset Other,
const SelectionDAG DAG,
int64_t &  Off 
)

◆ getBase()

SDValue llvm::BaseIndexOffset::getBase ( )
inline

Definition at line 47 of file SelectionDAGAddressAnalysis.h.

Referenced by findBaseOffset(), and peekThroughBitcast().

◆ getIndex()

SDValue llvm::BaseIndexOffset::getIndex ( )
inline

Definition at line 48 of file SelectionDAGAddressAnalysis.h.

◆ match()

BaseIndexOffset BaseIndexOffset::match ( SDValue  Ptr,
const SelectionDAG DAG 
)
static

The documentation for this class was generated from the following files: