summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-28 18:52:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-28 18:52:32 +0000
commitbcf1b4120f8db8fa5f374c930851ea16d19ae906 (patch)
tree4b11c0959909772e4b128a9ec9e5df11fe04ec0e /llvm
parent8f1510cfd393b5abf248e129c68abac7db96da31 (diff)
downloadbcm5719-llvm-bcf1b4120f8db8fa5f374c930851ea16d19ae906.tar.gz
bcm5719-llvm-bcf1b4120f8db8fa5f374c930851ea16d19ae906.zip
TargetRegisterClass specifies the desired spill alignment. However, it cannot be honored if stack alignment is smaller.
llvm-svn: 30648
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index 81d9724be42..5a18b920fc9 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -190,7 +190,12 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
int FrameIdx;
if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
// Nope, just spill it anywhere convenient.
- FrameIdx = FFI->CreateStackObject(RC->getSize(), RC->getAlignment());
+ unsigned Align = RC->getAlignment();
+ unsigned StackAlign = TFI->getStackAlignment();
+ // We may not be able to sastify the desired alignment specification of
+ // the TargetRegisterClass if the stack alignment is smaller. Use the min.
+ Align = std::min(Align, StackAlign);
+ FrameIdx = FFI->CreateStackObject(RC->getSize(), Align);
if ((unsigned)FrameIdx < MinCSFrameIndex) MinCSFrameIndex = FrameIdx;
if ((unsigned)FrameIdx > MaxCSFrameIndex) MaxCSFrameIndex = FrameIdx;
} else {
OpenPOWER on IntegriCloud