From 57d294f2acc30f843df0c6e07146e0391102f987 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 9 May 2005 04:28:51 +0000 Subject: [PATCH] Don't use the load/store instruction as the source pointer, use the pointer being stored/loaded through! llvm-svn: 21806 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 ++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c9ce79622007..26aa570e9374 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1329,6 +1329,8 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, } SDOperand SelectionDAG::getSrcValue(const Value *V, int Offset) { + assert((!V || isa(V->getType())) && + "SrcValue is not a pointer?"); SDNode *&N = ValueNodes[std::make_pair(V, Offset)]; if (N) return SDOperand(N, 0); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 7595e84f0264..c89f16a6e958 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -624,7 +624,7 @@ void SelectionDAGLowering::visitLoad(LoadInst &I) { } SDOperand L = DAG.getLoad(TLI.getValueType(I.getType()), Root, Ptr, - DAG.getSrcValue(&I)); + DAG.getSrcValue(I.getOperand(0))); setValue(&I, L); if (I.isVolatile()) @@ -640,7 +640,7 @@ void SelectionDAGLowering::visitStore(StoreInst &I) { SDOperand Ptr = getValue(I.getOperand(1)); // DAG.setRoot(DAG.getNode(ISD::STORE, MVT::Other, getRoot(), Src, Ptr)); DAG.setRoot(DAG.getNode(ISD::STORE, MVT::Other, getRoot(), Src, Ptr, - DAG.getSrcValue(&I))); + DAG.getSrcValue(I.getOperand(1)))); } void SelectionDAGLowering::visitCall(CallInst &I) {