summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-03-05 02:43:26 +0000
committerHans Wennborg <hans@hanshq.net>2014-03-05 02:43:26 +0000
commit2f471c83a0bb19806053e2d784a97f153fbb8771 (patch)
treef886f798e01115292c0d04256abe2e65f85bf087 /include
parent3b9afd308728feb1853596bbb8ccd57cf5f6b3b9 (diff)
downloadllvm-2f471c83a0bb19806053e2d784a97f153fbb8771.tar.gz
llvm-2f471c83a0bb19806053e2d784a97f153fbb8771.tar.bz2
llvm-2f471c83a0bb19806053e2d784a97f153fbb8771.tar.xz
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/FunctionLoweringInfo.h3
-rw-r--r--include/llvm/CodeGen/MachineFrameInfo.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/FunctionLoweringInfo.h b/include/llvm/CodeGen/FunctionLoweringInfo.h
index 50d320f8e8..854cac250c 100644
--- a/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -41,6 +41,7 @@ class MachineBasicBlock;
class MachineFunction;
class MachineModuleInfo;
class MachineRegisterInfo;
+class SelectionDAG;
class TargetLowering;
class Value;
@@ -125,7 +126,7 @@ public:
/// set - Initialize this FunctionLoweringInfo with the given Function
/// and its associated MachineFunction.
///
- void set(const Function &Fn, MachineFunction &MF);
+ void set(const Function &Fn, MachineFunction &MF, SelectionDAG *DAG);
/// clear - Clear out all the function-specific state. This returns this
/// FunctionLoweringInfo to an empty state, ready to be used for a
diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h
index 0699863311..1dedd74492 100644
--- a/include/llvm/CodeGen/MachineFrameInfo.h
+++ b/include/llvm/CodeGen/MachineFrameInfo.h
@@ -249,6 +249,7 @@ public:
LocalFrameSize = 0;
LocalFrameMaxAlign = 0;
UseLocalStackAllocationBlock = false;
+ HasInlineAsmWithSPAdjust = false;
}
/// hasStackObjects - Return true if there are any stack objects in this