[llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun May 8 16:58:26 PDT 2005
Changes in directory llvm/lib/Analysis:
BasicAliasAnalysis.cpp updated: 1.69 -> 1.70
---
Log message:
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
---
Diffs of the changes: (+6 -0)
BasicAliasAnalysis.cpp | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.69 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.70
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.69 Fri May 6 00:21:04 2005
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Sun May 8 18:58:12 2005
@@ -239,6 +239,12 @@
// 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.
More information about the llvm-commits
mailing list