diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-05-08 23:58:12 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-05-08 23:58:12 +0000 |
| commit | bb0bfc470288152530aa9bcc55896939f6da3bb1 (patch) | |
| tree | e3d4f070ff8bcc0324786e2b2b6bfef28e5d59cd /llvm | |
| parent | af008dcdd10152a2a64ff07abf44510d19b4d2f4 (diff) | |
| download | bcm5719-llvm-bb0bfc470288152530aa9bcc55896939f6da3bb1.tar.gz bcm5719-llvm-bb0bfc470288152530aa9bcc55896939f6da3bb1.zip | |
By definition, 'tail' calls cannot access the stack frame of their caller.
Expose this as a simple form of mod/ref information. This implements
BasicAA/tailcall-modref.ll
llvm-svn: 21796
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 334ef4a7d56..1110a017de9 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -239,6 +239,12 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { // because it simply can't get its address. if (!AddressMightEscape(AI)) return NoModRef; + + // If this is a tail call and P points to a stack location, we know that + // the tail call cannot access or modify the local stack. + if (CallInst *CI = dyn_cast<CallInst>(CS.getInstruction())) + if (CI->isTailCall() && isa<AllocaInst>(AI)) + return NoModRef; } // The AliasAnalysis base class has some smarts, lets use them. |

