summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-07-02 20:16:09 +0000
committerDale Johannesen <dalej@apple.com>2010-07-02 20:16:09 +0000
commit4d887f7ca7ce4a43413d68436c4420cfa1cee1b6 (patch)
tree3868b7813f2960006f07a7d42dde054053e0eba0 /llvm/lib/CodeGen/PrologEpilogInserter.cpp
parentdf8429aeb40a02b5fa184b141a1f484f010b3eb6 (diff)
downloadbcm5719-llvm-4d887f7ca7ce4a43413d68436c4420cfa1cee1b6.tar.gz
bcm5719-llvm-4d887f7ca7ce4a43413d68436c4420cfa1cee1b6.zip
Propagate the AlignStack bit in InlineAsm's to the
PrologEpilog code, and use it to determine whether the asm forces stack alignment or not. gcc consistently does not do this for GCC-style asms; Apple gcc inconsistently sometimes does it for asm blocks. There is no convenient place to put a bit in either the SDNode or the MachineInstr form, so I've added an extra operand to each; unlovely, but it does allow for expansion for more bits, should we need it. PR 5125. Some existing testcases are affected. The operand lists of the SDNode and MachineInstr forms are indexed with awesome mnemonics, like "2"; I may fix this someday, but not now. I'm not making it any worse. If anyone is inspired I think you can find all the right places from this patch. llvm-svn: 107506
Diffstat (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index e92b44fcff1..62b7c21cc8a 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -158,9 +158,9 @@ void PEI::calculateCallsInformation(MachineFunction &Fn) {
AdjustsStack = true;
FrameSDOps.push_back(I);
} else if (I->isInlineAsm()) {
- // An InlineAsm might be a call; assume it is to get the stack frame
- // aligned correctly for calls.
- AdjustsStack = true;
+ // Some inline asm's need a stack frame, as indicated by operand 1.
+ if (I->getOperand(1).getImm())
+ AdjustsStack = true;
}
MFI->setAdjustsStack(AdjustsStack);
OpenPOWER on IntegriCloud