[llvm-commits] [llvm] r61093 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp

Dan Gohman gohman at apple.com
Tue Dec 16 10:25:37 PST 2008


Author: djg
Date: Tue Dec 16 12:25:36 2008
New Revision: 61093

URL: http://llvm.org/viewvc/llvm-project?rev=61093&view=rev
Log:
Preserve SourceValue information when lowering produces multiple loads from
different offsets within the same stack slot.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp?rev=61093&r1=61092&r2=61093&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp Tue Dec 16 12:25:36 2008
@@ -19,6 +19,7 @@
 
 #include "LegalizeTypes.h"
 #include "llvm/Target/TargetData.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
 using namespace llvm;
 
 //===----------------------------------------------------------------------===//
@@ -83,12 +84,14 @@
   unsigned Alignment =
     TLI.getTargetData()->getPrefTypeAlignment(NOutVT.getTypeForMVT());
   SDValue StackPtr = DAG.CreateStackTemporary(InVT, Alignment);
+  int SPFI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex();
+  const Value *SV = PseudoSourceValue::getFixedStack(SPFI);
 
   // Emit a store to the stack slot.
-  SDValue Store = DAG.getStore(DAG.getEntryNode(), InOp, StackPtr, NULL, 0);
+  SDValue Store = DAG.getStore(DAG.getEntryNode(), InOp, StackPtr, SV, 0);
 
   // Load the first half from the stack slot.
-  Lo = DAG.getLoad(NOutVT, Store, StackPtr, NULL, 0);
+  Lo = DAG.getLoad(NOutVT, Store, StackPtr, SV, 0);
 
   // Increment the pointer to the other half.
   unsigned IncrementSize = NOutVT.getSizeInBits() / 8;
@@ -96,7 +99,7 @@
                          DAG.getIntPtrConstant(IncrementSize));
 
   // Load the second half from the stack slot.
-  Hi = DAG.getLoad(NOutVT, Store, StackPtr, NULL, 0, false,
+  Hi = DAG.getLoad(NOutVT, Store, StackPtr, SV, IncrementSize, false,
                    MinAlign(Alignment, IncrementSize));
 
   // Handle endianness of the load.





More information about the llvm-commits mailing list