Use the subtarget on the dag to get TargetFrameLowering rather
authorEric Christopher <echristo@gmail.com>
Thu, 9 Oct 2014 01:35:27 +0000 (01:35 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 9 Oct 2014 01:35:27 +0000 (01:35 +0000)
than off the target machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219378 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 95825e6571e9a54573ab3d1bb87f12471ac4136d..f901823f1eb3b784d991d1a56cbf8ef5fd77a8f5 100644 (file)
@@ -1627,7 +1627,7 @@ void SelectionDAGLegalize::ExpandDYNAMIC_STACKALLOC(SDNode* Node,
   Chain = SP.getValue(1);
   unsigned Align = cast<ConstantSDNode>(Tmp3)->getZExtValue();
   unsigned StackAlign =
   Chain = SP.getValue(1);
   unsigned Align = cast<ConstantSDNode>(Tmp3)->getZExtValue();
   unsigned StackAlign =
-      TM.getSubtargetImpl()->getFrameLowering()->getStackAlignment();
+      DAG.getSubtarget().getFrameLowering()->getStackAlignment();
   Tmp1 = DAG.getNode(ISD::SUB, dl, VT, SP, Size);       // Value
   if (Align > StackAlign)
     Tmp1 = DAG.getNode(ISD::AND, dl, VT, Tmp1,
   Tmp1 = DAG.getNode(ISD::SUB, dl, VT, SP, Size);       // Value
   if (Align > StackAlign)
     Tmp1 = DAG.getNode(ISD::AND, dl, VT, Tmp1,
index 8f3da6f2c323e4664201d2cdfa7f5188a4277b4f..733a72887f2d6c8f4d48ddac22aba7ebbca1b208 100644 (file)
@@ -3441,7 +3441,7 @@ void SelectionDAGBuilder::visitAlloca(const AllocaInst &I) {
   // the stack alignment, ignore it.  If the size is greater than or equal to
   // the stack alignment, we note this in the DYNAMIC_STACKALLOC node.
   unsigned StackAlign =
   // the stack alignment, ignore it.  If the size is greater than or equal to
   // the stack alignment, we note this in the DYNAMIC_STACKALLOC node.
   unsigned StackAlign =
-      TM.getSubtargetImpl()->getFrameLowering()->getStackAlignment();
+      DAG.getSubtarget().getFrameLowering()->getStackAlignment();
   if (Align <= StackAlign)
     Align = 0;
 
   if (Align <= StackAlign)
     Align = 0;