29 Off = Other.Offset - Offset;
31 if ((Other.Index == Index) && (Other.IsIndexSignExt == IsIndexSignExt)) {
33 if (Other.Base ==
Base)
37 if (
auto *A = dyn_cast<GlobalAddressSDNode>(
Base))
38 if (
auto *
B = dyn_cast<GlobalAddressSDNode>(Other.Base))
39 if (A->getGlobal() ==
B->getGlobal()) {
40 Off +=
B->getOffset() - A->getOffset();
45 if (
auto *A = dyn_cast<ConstantPoolSDNode>(
Base))
46 if (
auto *
B = dyn_cast<ConstantPoolSDNode>(Other.Base)) {
48 A->isMachineConstantPoolEntry() ==
B->isMachineConstantPoolEntry();
50 if (A->isMachineConstantPoolEntry())
51 IsMatch = A->getMachineCPVal() ==
B->getMachineCPVal();
53 IsMatch = A->getConstVal() ==
B->getConstVal();
56 Off +=
B->getOffset() - A->getOffset();
66 if (
auto *A = dyn_cast<FrameIndexSDNode>(
Base))
67 if (
auto *
B = dyn_cast<FrameIndexSDNode>(Other.Base))
87 bool IsIndexSignExt =
false;
91 if (
auto *
C = dyn_cast<ConstantSDNode>(N->
getOffset()))
92 Offset +=
C->getSExtValue();
96 if (
auto *
C = dyn_cast<ConstantSDNode>(N->
getOffset()))
97 Offset -=
C->getSExtValue();
107 if (
auto *
C = dyn_cast<ConstantSDNode>(Base->
getOperand(1)))
109 Offset +=
C->getSExtValue();
115 if (
auto *
C = dyn_cast<ConstantSDNode>(Base->
getOperand(1))) {
116 Offset +=
C->getSExtValue();
123 auto *LSBase = cast<LSBaseSDNode>(Base.
getNode());
125 if (LSBase->isIndexed() && Base.
getResNo() == IndexResNo)
126 if (
auto *
C = dyn_cast<ConstantSDNode>(LSBase->getOffset())) {
127 auto Off =
C->getSExtValue();
162 IsIndexSignExt =
true;
170 Offset += cast<ConstantSDNode>(Index->
getOperand(1))->getSExtValue();
174 IsIndexSignExt =
true;
176 IsIndexSignExt =
false;
177 Base = PotentialBase;
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
This class represents lattice values for constants.
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
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...
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
static BaseIndexOffset match(const LSBaseSDNode *N, const SelectionDAG &DAG)
Parses tree in Ptr for base, index, offset addresses.
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
bool equalBaseIndex(const BaseIndexOffset &Other, const SelectionDAG &DAG) const
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.