Revert "[DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI."

This reverts commit r306498 which appears to cause a compilrt-rt test failures

llvm-svn: 306501
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
index f954a52..d2e0dbb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
@@ -11,7 +11,6 @@
 
 #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"
 #include "llvm/CodeGen/ISDOpcodes.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
 
@@ -27,28 +26,20 @@
 
   // Match GlobalAddresses
   if (Index == Other.Index)
-    if (auto *A = dyn_cast<GlobalAddressSDNode>(Base))
-      if (auto *B = dyn_cast<GlobalAddressSDNode>(Other.Base))
+    if (GlobalAddressSDNode *A = dyn_cast<GlobalAddressSDNode>(Base))
+      if (GlobalAddressSDNode *B = dyn_cast<GlobalAddressSDNode>(Other.Base))
         if (A->getGlobal() == B->getGlobal()) {
           Off += B->getOffset() - A->getOffset();
           return true;
         }
 
-  // Match FrameIndexes
-  if (Index == Other.Index)
-    if (auto *A = dyn_cast<FrameIndexSDNode>(Base))
-      if (auto *B = dyn_cast<FrameIndexSDNode>(Other.Base)) {
-        const MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
-        Off += MFI.getObjectOffset(B->getIndex()) -
-               MFI.getObjectOffset(A->getIndex());
-        return true;
-      }
+  // TODO: we should be able to add FrameIndex analysis improvements here.
 
   return false;
 }
 
 /// Parses tree in Ptr for base, index, offset addresses.
-BaseIndexOffset BaseIndexOffset::match(SDValue Ptr, const SelectionDAG &DAG) {
+BaseIndexOffset BaseIndexOffset::match(SDValue Ptr) {
   // (((B + I*M) + c)) + c ...
   SDValue Base = Ptr;
   SDValue Index = SDValue();