LLVM 20.0.0git
|
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, bool IsIndexSignExt) | |
BaseIndexOffset (SDValue Base, SDValue Index, int64_t Offset, bool IsIndexSignExt) | |
SDValue | getBase () |
SDValue | getBase () const |
SDValue | getIndex () |
SDValue | getIndex () const |
void | addToOffset (int64_t VectorOff) |
bool | hasValidOffset () const |
int64_t | getOffset () const |
bool | equalBaseIndex (const BaseIndexOffset &Other, const SelectionDAG &DAG, int64_t &Off) const |
bool | equalBaseIndex (const BaseIndexOffset &Other, const SelectionDAG &DAG) const |
bool | contains (const SelectionDAG &DAG, int64_t BitSize, const BaseIndexOffset &Other, int64_t OtherBitSize, int64_t &BitOffset) const |
bool | contains (const SelectionDAG &DAG, int64_t BitSize, const BaseIndexOffset &Other, int64_t OtherBitSize) const |
void | print (raw_ostream &OS) const |
void | dump () const |
Static Public Member Functions | |
static bool | computeAliasing (const SDNode *Op0, const LocationSize NumBytes0, const SDNode *Op1, const LocationSize NumBytes1, const SelectionDAG &DAG, bool &IsAlias) |
static BaseIndexOffset | match (const SDNode *N, const SelectionDAG &DAG) |
Parses tree in N for base, index, offset addresses. | |
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.
|
default |
Definition at line 42 of file SelectionDAGAddressAnalysis.h.
|
inline |
Definition at line 44 of file SelectionDAGAddressAnalysis.h.
|
inline |
Definition at line 53 of file SelectionDAGAddressAnalysis.h.
|
static |
Definition at line 93 of file SelectionDAGAddressAnalysis.cpp.
References A, B, llvm::GISelAddressing::BaseIndexOffset::getBase(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::MachineFunction::getFrameInfo(), llvm::SelectionDAG::getMachineFunction(), llvm::LocationSize::getValue(), llvm::LocationSize::hasValue(), llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::LocationSize::isScalable(), and llvm::PatternMatch::match().
|
inline |
Definition at line 77 of file SelectionDAGAddressAnalysis.h.
References contains(), and llvm::Other.
bool BaseIndexOffset::contains | ( | const SelectionDAG & | DAG, |
int64_t | BitSize, | ||
const BaseIndexOffset & | Other, | ||
int64_t | OtherBitSize, | ||
int64_t & | BitOffset | ||
) | const |
Definition at line 177 of file SelectionDAGAddressAnalysis.cpp.
References llvm::Other.
LLVM_DUMP_METHOD void BaseIndexOffset::dump | ( | ) | const |
Definition at line 316 of file SelectionDAGAddressAnalysis.cpp.
References llvm::dbgs(), and llvm::print().
|
inline |
Definition at line 65 of file SelectionDAGAddressAnalysis.h.
References equalBaseIndex(), and llvm::Other.
bool BaseIndexOffset::equalBaseIndex | ( | const BaseIndexOffset & | Other, |
const SelectionDAG & | DAG, | ||
int64_t & | Off | ||
) | const |
Definition at line 24 of file SelectionDAGAddressAnalysis.cpp.
References A, B, llvm::sampleprof::Base, llvm::MachineFunction::getFrameInfo(), llvm::SelectionDAG::getMachineFunction(), llvm::MachineFrameInfo::getObjectOffset(), llvm::GISelAddressing::BaseIndexOffset::hasValidOffset(), llvm::MachineFrameInfo::isFixedObjectIndex(), and llvm::Other.
Referenced by equalBaseIndex().
|
inline |
Definition at line 49 of file SelectionDAGAddressAnalysis.h.
References llvm::sampleprof::Base.
|
inline |
Definition at line 50 of file SelectionDAGAddressAnalysis.h.
References llvm::sampleprof::Base.
|
inline |
Definition at line 51 of file SelectionDAGAddressAnalysis.h.
|
inline |
Definition at line 52 of file SelectionDAGAddressAnalysis.h.
|
inline |
Definition at line 57 of file SelectionDAGAddressAnalysis.h.
|
inline |
Definition at line 56 of file SelectionDAGAddressAnalysis.h.
|
static |
Parses tree in N for base, index, offset addresses.
Definition at line 301 of file SelectionDAGAddressAnalysis.cpp.
References llvm::GISelAddressing::BaseIndexOffset::BaseIndexOffset(), matchLSNode(), and N.
Referenced by llvm::SelectionDAG::areNonVolatileConsecutiveLoads(), performCONCAT_VECTORSCombine(), and TryDistrubutionADDVecReduce().
void BaseIndexOffset::print | ( | raw_ostream & | OS | ) | const |
Definition at line 320 of file SelectionDAGAddressAnalysis.cpp.
References llvm::sampleprof::Base, and OS.