diff options
author | Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com> | 2018-05-16 13:16:54 +0000 |
---|---|---|
committer | Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com> | 2018-05-16 13:16:54 +0000 |
commit | 2ba8fd4914a91beb116c39c008fc425e80f14a7c (patch) | |
tree | 14595e5535ae3b2440393787aff768568a8ebd94 /llvm/lib/Analysis/CaptureTracking.cpp | |
parent | 0c8f451a1b2ef0d6b6e01cd1ad56fe7cda440862 (diff) | |
download | bcm5719-llvm-2ba8fd4914a91beb116c39c008fc425e80f14a7c.tar.gz bcm5719-llvm-2ba8fd4914a91beb116c39c008fc425e80f14a7c.zip |
[BasicAA] Fix handling of invariant group launders
Summary:
A recent patch ([[ https://reviews.llvm.org/rL331587 | rL331587 ]]) to Capture Tracking taught it that the `launder_invariant_group` intrinsic captures its argument only by returning it. Unfortunately, BasicAA still considered every call instruction as a possible escape source and hence concluded that the result of a `launder_invariant_group` call cannot alias any local non-escaping value. This led to [[ https://bugs.llvm.org/show_bug.cgi?id=37458 | bug 37458 ]].
This patch updates the relevant check for escape sources in BasicAA.
Reviewers: Prazek, kuhar, rsmith, hfinkel, sanjoy, xbolva00
Reviewed By: hfinkel, xbolva00
Subscribers: JDevlieghere, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D46900
llvm-svn: 332466
Diffstat (limited to 'llvm/lib/Analysis/CaptureTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/CaptureTracking.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp index 782e277222f..54466cd3467 100644 --- a/llvm/lib/Analysis/CaptureTracking.cpp +++ b/llvm/lib/Analysis/CaptureTracking.cpp @@ -249,6 +249,8 @@ void llvm::PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker) { // launder.invariant.group only captures pointer by returning it, // so the pointer wasn't captured if returned pointer is not captured. + // Note that adding similar special cases for intrinsics requires handling + // them in 'isEscapeSource' in BasicAA. if (CS.getIntrinsicID() == Intrinsic::launder_invariant_group) { AddUses(I); break; |