diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-03-05 02:43:26 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-03-05 02:43:26 +0000 |
commit | acb842d5239afadd934ad2aef56b793d36436b19 (patch) | |
tree | 93f0afb2b539e8d39bdbfd7c1730ff4506405408 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 9a16d088f68c50510893e4997ea38e3fbf308bce (diff) | |
download | bcm5719-llvm-acb842d5239afadd934ad2aef56b793d36436b19.tar.gz bcm5719-llvm-acb842d5239afadd934ad2aef56b793d36436b19.zip |
Check for dynamic allocas and inline asm that clobbers sp before building
selection dag (PR19012)
In X86SelectionDagInfo::EmitTargetCodeForMemcpy we check with MachineFrameInfo
to make sure that ESI isn't used as a base pointer register before we choose to
emit rep movs (which clobbers esi).
The problem is that MachineFrameInfo wouldn't know about dynamic allocas or
inline asm that clobbers the stack pointer until SelectionDAGBuilder has
encountered them.
This patch fixes the problem by checking for such things when building the
FunctionLoweringInfo.
Differential Revision: http://llvm-reviews.chandlerc.com/D2954
llvm-svn: 202930
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 01c343818bd..787810f8db2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -417,7 +417,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { SplitCriticalSideEffectEdges(const_cast<Function&>(Fn), this); CurDAG->init(*MF, TLI); - FuncInfo->set(Fn, *MF); + FuncInfo->set(Fn, *MF, CurDAG); if (UseMBPI && OptLevel != CodeGenOpt::None) FuncInfo->BPI = &getAnalysis<BranchProbabilityInfo>(); @@ -427,7 +427,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { SDB->init(GFI, *AA, LibInfo); MF->setHasInlineAsm(false); - MF->getFrameInfo()->setHasInlineAsmWithSPAdjust(false); SelectAllBasicBlocks(Fn); |