mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 07:39:31 +00:00
Fix a comment, and a bug where we weren't applying the tail call logic in cases that failed the first test.
llvm-svn: 47253
This commit is contained in:
parent
0ef73a5d06
commit
b0891af18b
@ -252,19 +252,21 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
|
||||
if (Object &&
|
||||
(isa<AllocationInst>(Object) || isa<Argument>(Object))) {
|
||||
// Okay, the pointer is to a stack allocated (or effectively so, for
|
||||
// for noalias parameters) object. If we can prove that
|
||||
// the pointer never "escapes", then we know the call cannot clobber it,
|
||||
// because it simply can't get its address.
|
||||
// for noalias parameters) object. If the address of this object doesn't
|
||||
// escape from this function body to a callee, then we know that no
|
||||
// callees can mod/ref it unless they are actually passed it.
|
||||
if (isa<AllocationInst>(Object) ||
|
||||
cast<Argument>(Object)->hasByValAttr() ||
|
||||
cast<Argument>(Object)->hasNoAliasAttr())
|
||||
if (!AddressMightEscape(Object)) {
|
||||
bool passedAsArg = false;
|
||||
for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
|
||||
CI != CE; ++CI)
|
||||
if (getUnderlyingObject(CI->get()) == P)
|
||||
return AliasAnalysis::getModRefInfo(CS, P, Size);
|
||||
|
||||
return NoModRef;
|
||||
passedAsArg = true;
|
||||
|
||||
if (!passedAsArg)
|
||||
return NoModRef;
|
||||
}
|
||||
|
||||
// If this is a tail call and P points to a stack location, we know that
|
||||
|
Loading…
Reference in New Issue
Block a user