diff options
author | Dan Gohman <gohman@apple.com> | 2007-07-18 16:29:46 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-07-18 16:29:46 +0000 |
commit | 48613b930a34d6f98e7d3dd86aa49cc3dbd61c85 (patch) | |
tree | ebb79ea1ee5e3bc1fdf38541a811a8b804f0679a /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | b5cd24973cdcbc6da0b7e05700d6f4207aa20baf (diff) |
It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index d4651fd6ab..9256faabeb 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2327,13 +2327,13 @@ void SelectionDAGLowering::visitAlloca(AllocaInst &I) { AllocSize = DAG.getNode(ISD::MUL, IntPtr, AllocSize, getIntPtrConstant(TySize)); - // Handle alignment. If the requested alignment is less than or equal to the - // stack alignment, ignore it and round the size of the allocation up to the - // stack alignment size. If the size is greater than the stack alignment, we - // note this in the DYNAMIC_STACKALLOC node. + // Handle alignment. If the requested alignment is less than the stack + // alignment, ignore it and round the size of the allocation up to the stack + // alignment size. If the size is greater than or equal to the stack + // alignment, we note this in the DYNAMIC_STACKALLOC node. unsigned StackAlign = TLI.getTargetMachine().getFrameInfo()->getStackAlignment(); - if (Align <= StackAlign) { + if (Align < StackAlign) { Align = 0; // Add SA-1 to the size. AllocSize = DAG.getNode(ISD::ADD, AllocSize.getValueType(), AllocSize, |