LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
BaseIndexOffset Struct Reference
Collaboration diagram for BaseIndexOffset:
Collaboration graph
[legend]

Public Member Functions

 BaseIndexOffset ()
 
 BaseIndexOffset (SDValue Base, SDValue Index, int64_t Offset, bool IsIndexSignExt)
 
bool equalBaseIndex (const BaseIndexOffset &Other)
 

Static Public Member Functions

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

Public Attributes

SDValue Base
 
SDValue Index
 
int64_t Offset
 
bool IsIndexSignExt
 

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 8502 of file DAGCombiner.cpp.

Constructor & Destructor Documentation

BaseIndexOffset::BaseIndexOffset ( )
inline

Definition at line 8508 of file DAGCombiner.cpp.

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

Definition at line 8510 of file DAGCombiner.cpp.

Member Function Documentation

bool BaseIndexOffset::equalBaseIndex ( const BaseIndexOffset Other)
inline

Definition at line 8514 of file DAGCombiner.cpp.

References Base, Index, and IsIndexSignExt.

static BaseIndexOffset BaseIndexOffset::match ( SDValue  Ptr)
inlinestatic

Parses tree in Ptr for base, index, offset addresses.

Definition at line 8520 of file DAGCombiner.cpp.

References llvm::ISD::ADD, llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::ISD::MUL, and llvm::ISD::SIGN_EXTEND.

Member Data Documentation

SDValue BaseIndexOffset::Base

Definition at line 8503 of file DAGCombiner.cpp.

Referenced by equalBaseIndex().

SDValue BaseIndexOffset::Index

Definition at line 8504 of file DAGCombiner.cpp.

Referenced by equalBaseIndex().

bool BaseIndexOffset::IsIndexSignExt

Definition at line 8506 of file DAGCombiner.cpp.

Referenced by equalBaseIndex().

int64_t BaseIndexOffset::Offset

Definition at line 8505 of file DAGCombiner.cpp.


The documentation for this struct was generated from the following file: