diff options
| author | James Molloy <james.molloy@arm.com> | 2016-01-07 13:33:28 +0000 |
|---|---|---|
| committer | James Molloy <james.molloy@arm.com> | 2016-01-07 13:33:28 +0000 |
| commit | 9971a6841c2df37b57eadc27d7a7ad4440cd8b70 (patch) | |
| tree | 6bd1672fe947b5f96bafb42bdaefc2a5410f0f6f /llvm/lib/Analysis/TargetTransformInfo.cpp | |
| parent | d337111f02263f80a253b3ee23f0552c03ab78d5 (diff) | |
| download | bcm5719-llvm-9971a6841c2df37b57eadc27d7a7ad4440cd8b70.tar.gz bcm5719-llvm-9971a6841c2df37b57eadc27d7a7ad4440cd8b70.zip | |
[GlobalsAA] Partially back out r248576
See PR25822 for a more full summary, but we were conflating the concepts of "capture" and "escape". We were proving nocapture and using that proof to infer noescape, which is not true. Escaped-ness is a function-local property - as soon as a value is used in a call argument it escapes. Capturedness is a related but distinct property. It implies a *temporally limited* escape. Consider:
static int a;
int b;
int g(int * nocapture arg);
int f() {
a = 2; // Even though a escapes to g, it is not captured so can be treated as non-escaping here.
g(&a); // But here it must be treated as escaping.
g(&b); // Now that g(&a) has returned we know it was not captured so we can treat it as non-escaping again.
}
The original commit did not sufficiently understand this nuance and so caused PR25822 and PR26046.
r248576 included both a performance improvement (which has been backed out) and a related conformance fix (which has been kept along with its testcase).
llvm-svn: 257058
Diffstat (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp')
0 files changed, 0 insertions, 0 deletions

