tracking the instructions causing loads and stores provides more information than...
authorAndrew Lenharth <andrewl@lenharth.org>
Wed, 29 Jun 2005 15:57:19 +0000 (15:57 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Wed, 29 Jun 2005 15:57:19 +0000 (15:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22311 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/Alpha/AlphaISelPattern.cpp

index 8a34a59a15e0ed8cbdee22564a96380d4a196cd4..8614e3ec4b6c950c9d60475eafe6b392fe5177b8 100644 (file)
@@ -1394,8 +1394,6 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
 }
 
 SDOperand SelectionDAG::getSrcValue(const Value *V, int Offset) {
-  assert((!V || isa<PointerType>(V->getType())) &&
-         "SrcValue is not a pointer?");
   SDNode *&N = ValueNodes[std::make_pair(V, Offset)];
   if (N) return SDOperand(N, 0);
 
index fa6d6d4d14cdc668fd551abe56a98f14ddb83017..6815054515079d2095c71c5024836b638081365c 100644 (file)
@@ -644,7 +644,7 @@ void SelectionDAGLowering::visitLoad(LoadInst &I) {
   }
 
   SDOperand L = DAG.getLoad(TLI.getValueType(I.getType()), Root, Ptr,
-                            DAG.getSrcValue(I.getOperand(0)));
+                            DAG.getSrcValue(&I));
   setValue(&I, L);
 
   if (I.isVolatile())
@@ -659,7 +659,7 @@ void SelectionDAGLowering::visitStore(StoreInst &I) {
   SDOperand Src = getValue(SrcV);
   SDOperand Ptr = getValue(I.getOperand(1));
   DAG.setRoot(DAG.getNode(ISD::STORE, MVT::Other, getRoot(), Src, Ptr,
-                          DAG.getSrcValue(I.getOperand(1))));
+                          DAG.getSrcValue(&I)));
 }
 
 void SelectionDAGLowering::visitCall(CallInst &I) {
index 6cba016e68370d7e0483e109447e41a3ee465479..bab3c6eed918a255dc029643d277f5adb78ced1f 100644 (file)
@@ -607,16 +607,15 @@ void AlphaISel::EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {
 //Find the offset of the arg in it's parent's function
 static int getValueOffset(const Value* v)
 {
-  static int uniqneg = -1;
   if (v == NULL)
-    return uniqneg--;
+    return 0;
 
   const Instruction* itarget = dyn_cast<Instruction>(v);
   const BasicBlock* btarget = itarget->getParent();
   const Function* ftarget = btarget->getParent();
 
   //offset due to earlier BBs
-  int i = 0;
+  int i = 1;
   for(Function::const_iterator ii = ftarget->begin(); &*ii != btarget; ++ii)
     i += ii->size();
 
@@ -1299,7 +1298,7 @@ unsigned AlphaISel::SelectExpr(SDOperand N) {
     has_sym = true;
 
     if (EnableAlphaLSMark)
-      BuildMI(BB, Alpha::MEMLABEL, 3).addImm(0).addImm(0).addImm(getUID());
+      BuildMI(BB, Alpha::MEMLABEL, 3).addImm(0).addImm(1).addImm(getUID());
 
     BuildMI(BB, Alpha::LDQl, 2, Result)
       .addGlobalAddress(cast<GlobalAddressSDNode>(N)->getGlobal())