@@ -1923,22 +1923,22 @@ bool isNotCapturedBeforeOrInLoop(const Value *V, const Loop *L,
1923
1923
L->getHeader ()->getTerminator (), DT);
1924
1924
}
1925
1925
1926
- // / Return true iff we can prove that a caller of this function can not inspect
1927
- // / the contents of the provided object in a well defined program .
1928
- bool isKnownNonEscaping (Value *Object, const Loop *L, DominatorTree *DT) {
1926
+ // / Return true if we can prove that a caller cannot inspect the object if an
1927
+ // / unwind occurs inside the loop .
1928
+ bool isNotVisibleOnUnwind (Value *Object, const Loop *L, DominatorTree *DT) {
1929
1929
if (isa<AllocaInst>(Object))
1930
1930
// Since the alloca goes out of scope, we know the caller can't retain a
1931
1931
// reference to it and be well defined. Thus, we don't need to check for
1932
1932
// capture.
1933
1933
return true ;
1934
1934
1935
1935
// For all other objects we need to know that the caller can't possibly
1936
- // have gotten a reference to the object. There are two components of
1937
- // that:
1938
- // 1) Object can't be escaped by this function. This is what
1939
- // PointerMayBeCaptured checks .
1940
- // 2 ) Object can't have been captured at definition site . For this, we
1941
- // need to know the return value is noalias .
1936
+ // have gotten a reference to the object prior to an unwind in the loop.
1937
+ // There are two components of that:
1938
+ // 1) Object can't have been captured prior to the definition site.
1939
+ // For this, we need to know the return value is noalias .
1940
+ // 1 ) Object can't be captured before or inside the loop . This is what
1941
+ // isNotCapturedBeforeOrInLoop() checks .
1942
1942
return isNoAliasCall (Object) && isNotCapturedBeforeOrInLoop (Object, L, DT);
1943
1943
}
1944
1944
@@ -2026,7 +2026,7 @@ bool llvm::promoteLoopAccessesToScalars(
2026
2026
// this by proving that the caller can't have a reference to the object
2027
2027
// after return and thus can't possibly load from the object.
2028
2028
Value *Object = getUnderlyingObject (SomePtr);
2029
- if (!isKnownNonEscaping (Object, CurLoop, DT))
2029
+ if (!isNotVisibleOnUnwind (Object, CurLoop, DT))
2030
2030
return false ;
2031
2031
// Subtlety: Alloca's aren't visible to callers, but *are* potentially
2032
2032
// visible to other threads if captured and used during their lifetimes.
0 commit comments