Michael Kruse via llvm-dev
unread,Aug 24, 2021, 5:24:08 PM8/24/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to LAMZED-SHORT, ANDREW (PGR), LLVM Developers
In addition to the LoopInfo itself, LoopInfoWrapperPass has
dependencies such as DominatorTree and ScalarEvolution. Using The
getAnalysis<T>(Function*) method will run LoopInfo and its
dependencies on-the-fly. However, this On-the-fly mechanism holds the
results for only one function at a time. Calling it for another one
will delete the result for the previous function. You saved the
LoopInfo using std::move, but it still requires some dependent
analysis even after LoopInfo has been computed, what the legacy pass
manager calls (in your case: ScalarEvolution). ScalarEvolution will
also been released after the call of getAnalysis for another function.
And using LoopInfo after it will result in use-after-free errors.
Solutions:
1. Instantiate your own pass manager for each function instead using
the on-the-fly mechanism, so you control the lifetime.
2. Use the new pass manager, which does not free any analyses until
explicitly invalidated.
MIchael
Am Mo., 23. Aug. 2021 um 07:02 Uhr schrieb LAMZED-SHORT, ANDREW (PGR)
via llvm-dev <llvm...@lists.llvm.org>:
> _______________________________________________
> LLVM Developers mailing list
> llvm...@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev