28 Off = Other.Offset - Offset;
30 if ((Other.Index == Index) && (Other.IsIndexSignExt == IsIndexSignExt)) {
32 if (Other.Base ==
Base)
36 if (
auto *A = dyn_cast<GlobalAddressSDNode>(
Base))
37 if (
auto *
B = dyn_cast<GlobalAddressSDNode>(Other.Base))
38 if (A->getGlobal() ==
B->getGlobal()) {
39 Off +=
B->getOffset() - A->getOffset();
44 if (
auto *A = dyn_cast<ConstantPoolSDNode>(
Base))
45 if (
auto *
B = dyn_cast<ConstantPoolSDNode>(Other.Base)) {
47 A->isMachineConstantPoolEntry() ==
B->isMachineConstantPoolEntry();
49 if (A->isMachineConstantPoolEntry())
50 IsMatch = A->getMachineCPVal() ==
B->getMachineCPVal();
52 IsMatch = A->getConstVal() ==
B->getConstVal();
55 Off +=
B->getOffset() - A->getOffset();
65 if (
auto *A = dyn_cast<FrameIndexSDNode>(
Base))
66 if (
auto *
B = dyn_cast<FrameIndexSDNode>(Other.Base))
86 bool IsIndexSignExt =
false;
90 if (
auto *
C = dyn_cast<ConstantSDNode>(N->
getOffset()))
91 Offset +=
C->getSExtValue();
95 if (
auto *
C = dyn_cast<ConstantSDNode>(N->
getOffset()))
96 Offset -=
C->getSExtValue();
106 if (
auto *
C = dyn_cast<ConstantSDNode>(Base->
getOperand(1)))
108 Offset +=
C->getSExtValue();
114 if (
auto *
C = dyn_cast<ConstantSDNode>(Base->
getOperand(1))) {
115 Offset +=
C->getSExtValue();
122 auto *LSBase = cast<LSBaseSDNode>(Base.
getNode());
124 if (LSBase->isIndexed() && Base.
getResNo() == IndexResNo)
125 if (
auto *
C = dyn_cast<ConstantSDNode>(LSBase->getOffset())) {
126 auto Off =
C->getSExtValue();
132 Base = LSBase->getBasePtr();
161 IsIndexSignExt =
true;
169 Offset += cast<ConstantSDNode>(Index->
getOperand(1))->getSExtValue();
173 IsIndexSignExt =
true;
175 IsIndexSignExt =
false;
176 Base = PotentialBase;
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
Compute iterated dominance frontiers using a linear time algorithm.
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc, or post-dec.
SDNode * getNode() const
get the SDNode which holds the desired result
bool equalBaseIndex(BaseIndexOffset &Other, const SelectionDAG &DAG)
Base class for LoadSDNode and StoreSDNode.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
static BaseIndexOffset match(LSBaseSDNode *N, const SelectionDAG &DAG)
Parses tree in Ptr for base, index, offset addresses.
MachineFunction & getMachineFunction() const
Simple integer binary arithmetic operators.
BaseIndexOffset()=default
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const SDValue & getOperand(unsigned Num) const
bool isFixedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a fixed stack object.
virtual SDValue unwrapAddress(SDValue N) const
const TargetLowering & getTargetLoweringInfo() const
Helper struct to parse and store a memory address as base + index + offset.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
const SDValue & getOffset() const
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
unsigned getResNo() const
get the index which selects a specific result in the SDNode
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
const SDValue & getBasePtr() const
This file describes how to lower LLVM code to machine code.