Stack Alignment: when creating stack objects in MachineFrameInfo, make sure
authorManman Ren <mren@apple.com>
Tue, 4 Dec 2012 00:52:33 +0000 (00:52 +0000)
committerManman Ren <mren@apple.com>
Tue, 4 Dec 2012 00:52:33 +0000 (00:52 +0000)
commit69261a644298bff1497d46c8cd38d688670f307b
tree6552a5e87e17643db2693dab9046f435099467aa
parent46608c0f648af75dd7260c3d881ca17353bb5982
Stack Alignment: when creating stack objects in MachineFrameInfo, make sure
the alignment is clamped to TargetFrameLowering.getStackAlignment if the target
does not support stack realignment or the option "realign-stack" is off.

This will cause miscompile if the address is treated as aligned and add is
replaced with or in DAGCombine.

Added a bool StackRealignable to TargetFrameLowering to check whether stack
realignment is implemented for the target. Also added a bool RealignOption
to MachineFrameInfo to check whether the option "realign-stack" is on.

rdar://12713765

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169197 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineFrameInfo.h
include/llvm/Target/TargetFrameLowering.h
lib/CodeGen/MachineFunction.cpp
test/CodeGen/ARM/alloc-no-stack-realign.ll [new file with mode: 0644]