|
@@ -4915,7 +4915,7 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) {
|
|
|
return SDValue();
|
|
|
|
|
|
// Loads must share the same base address
|
|
|
- BaseIndexOffset Ptr = BaseIndexOffset::match(L->getBasePtr());
|
|
|
+ BaseIndexOffset Ptr = BaseIndexOffset::match(L->getBasePtr(), DAG);
|
|
|
int64_t ByteOffsetFromBase = 0;
|
|
|
if (!Base)
|
|
|
Base = Ptr;
|
|
@@ -12442,7 +12442,7 @@ void DAGCombiner::getStoreMergeCandidates(
|
|
|
StoreSDNode *St, SmallVectorImpl<MemOpLink> &StoreNodes) {
|
|
|
// This holds the base pointer, index, and the offset in bytes from the base
|
|
|
// pointer.
|
|
|
- BaseIndexOffset BasePtr = BaseIndexOffset::match(St->getBasePtr());
|
|
|
+ BaseIndexOffset BasePtr = BaseIndexOffset::match(St->getBasePtr(), DAG);
|
|
|
EVT MemVT = St->getMemoryVT();
|
|
|
|
|
|
// We must have a base and an offset.
|
|
@@ -12462,8 +12462,8 @@ void DAGCombiner::getStoreMergeCandidates(
|
|
|
BaseIndexOffset LBasePtr;
|
|
|
// Match on loadbaseptr if relevant.
|
|
|
if (IsLoadSrc)
|
|
|
- LBasePtr =
|
|
|
- BaseIndexOffset::match(cast<LoadSDNode>(St->getValue())->getBasePtr());
|
|
|
+ LBasePtr = BaseIndexOffset::match(
|
|
|
+ cast<LoadSDNode>(St->getValue())->getBasePtr(), DAG);
|
|
|
|
|
|
auto CandidateMatch = [&](StoreSDNode *Other, BaseIndexOffset &Ptr,
|
|
|
int64_t &Offset) -> bool {
|
|
@@ -12477,7 +12477,7 @@ void DAGCombiner::getStoreMergeCandidates(
|
|
|
if (IsLoadSrc) {
|
|
|
// The Load's Base Ptr must also match
|
|
|
if (LoadSDNode *OtherLd = dyn_cast<LoadSDNode>(Other->getValue())) {
|
|
|
- auto LPtr = BaseIndexOffset::match(OtherLd->getBasePtr());
|
|
|
+ auto LPtr = BaseIndexOffset::match(OtherLd->getBasePtr(), DAG);
|
|
|
if (!(LBasePtr.equalBaseIndex(LPtr, DAG)))
|
|
|
return false;
|
|
|
} else
|
|
@@ -12491,7 +12491,7 @@ void DAGCombiner::getStoreMergeCandidates(
|
|
|
if (!(Other->getValue().getOpcode() == ISD::EXTRACT_VECTOR_ELT ||
|
|
|
Other->getValue().getOpcode() == ISD::EXTRACT_SUBVECTOR))
|
|
|
return false;
|
|
|
- Ptr = BaseIndexOffset::match(Other->getBasePtr());
|
|
|
+ Ptr = BaseIndexOffset::match(Other->getBasePtr(), DAG);
|
|
|
return (BasePtr.equalBaseIndex(Ptr, DAG, Offset));
|
|
|
};
|
|
|
// We looking for a root node which is an ancestor to all mergable
|
|
@@ -12834,7 +12834,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|
|
if (Ld->getMemoryVT() != MemVT)
|
|
|
break;
|
|
|
|
|
|
- BaseIndexOffset LdPtr = BaseIndexOffset::match(Ld->getBasePtr());
|
|
|
+ BaseIndexOffset LdPtr = BaseIndexOffset::match(Ld->getBasePtr(), DAG);
|
|
|
// If this is not the first ptr that we check.
|
|
|
int64_t LdOffset = 0;
|
|
|
if (LdBasePtr.getBase().getNode()) {
|
|
@@ -16602,8 +16602,8 @@ bool DAGCombiner::isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const {
|
|
|
unsigned NumBytes1 = Op1->getMemoryVT().getSizeInBits() >> 3;
|
|
|
|
|
|
// Check for BaseIndexOffset matching.
|
|
|
- BaseIndexOffset BasePtr0 = BaseIndexOffset::match(Op0->getBasePtr());
|
|
|
- BaseIndexOffset BasePtr1 = BaseIndexOffset::match(Op1->getBasePtr());
|
|
|
+ BaseIndexOffset BasePtr0 = BaseIndexOffset::match(Op0->getBasePtr(), DAG);
|
|
|
+ BaseIndexOffset BasePtr1 = BaseIndexOffset::match(Op1->getBasePtr(), DAG);
|
|
|
int64_t PtrDiff;
|
|
|
if (BasePtr0.equalBaseIndex(BasePtr1, DAG, PtrDiff))
|
|
|
return !((NumBytes0 <= PtrDiff) || (PtrDiff + NumBytes1 <= 0));
|
|
@@ -16813,7 +16813,7 @@ SDValue DAGCombiner::FindBetterChain(SDNode *N, SDValue OldChain) {
|
|
|
bool DAGCombiner::findBetterNeighborChains(StoreSDNode *St) {
|
|
|
// This holds the base pointer, index, and the offset in bytes from the base
|
|
|
// pointer.
|
|
|
- BaseIndexOffset BasePtr = BaseIndexOffset::match(St->getBasePtr());
|
|
|
+ BaseIndexOffset BasePtr = BaseIndexOffset::match(St->getBasePtr(), DAG);
|
|
|
|
|
|
// We must have a base and an offset.
|
|
|
if (!BasePtr.getBase().getNode())
|
|
@@ -16839,7 +16839,7 @@ bool DAGCombiner::findBetterNeighborChains(StoreSDNode *St) {
|
|
|
break;
|
|
|
|
|
|
// Find the base pointer and offset for this memory node.
|
|
|
- BaseIndexOffset Ptr = BaseIndexOffset::match(Index->getBasePtr());
|
|
|
+ BaseIndexOffset Ptr = BaseIndexOffset::match(Index->getBasePtr(), DAG);
|
|
|
|
|
|
// Check that the base pointer is the same as the original one.
|
|
|
if (!BasePtr.equalBaseIndex(Ptr, DAG))
|