[llvm] r261319 - [LPM] Document the new helpers to make it easy to get consistent require

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 02:59:43 PST 2016


Author: chandlerc
Date: Fri Feb 19 04:59:43 2016
New Revision: 261319

URL: http://llvm.org/viewvc/llvm-project?rev=261319&view=rev
Log:
[LPM] Document the new helpers to make it easy to get consistent require
and preserve behavior from loop passes.

Differential Revision: http://reviews.llvm.org/D17443

Modified:
    llvm/trunk/docs/WritingAnLLVMPass.rst

Modified: llvm/trunk/docs/WritingAnLLVMPass.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.rst?rev=261319&r1=261318&r2=261319&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.rst (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.rst Fri Feb 19 04:59:43 2016
@@ -525,6 +525,14 @@ interface.  Implementing a loop pass is
 these methods should return ``true`` if they modified the program, or ``false``
 if they didn't.
 
+A ``LoopPass`` subclass which is intended to run as part of the main loop pass
+pipeline needs to preserve all of the same *function* analyses that the other
+loop passes in its pipeline require. To make that easier,
+a ``getLoopAnalysisUsage`` function is provided by ``LoopUtils.h``. It can be
+called within the subclass's ``getAnalysisUsage`` override to get consistent
+and correct behavior. Analogously, ``INITIALIZE_PASS_DEPENDENCY(LoopPass)``
+will initialize this set of function analyses.
+
 The ``doInitialization(Loop *, LPPassManager &)`` method
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 




More information about the llvm-commits mailing list