summaryrefslogtreecommitdiffstats
path: root/llvm/docs/WritingAnLLVMPass.rst
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-02-19 10:59:43 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-02-19 10:59:43 +0000
commit567888395ec69e6efeff923b92767fd7271b417a (patch)
treedecff3724b2fecac9af392b19cfb9bff11872f17 /llvm/docs/WritingAnLLVMPass.rst
parent73bcca5b3dd8fcd1bb62a256473d559488d6729f (diff)
downloadbcm5719-llvm-567888395ec69e6efeff923b92767fd7271b417a.tar.gz
bcm5719-llvm-567888395ec69e6efeff923b92767fd7271b417a.zip
[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 llvm-svn: 261319
Diffstat (limited to 'llvm/docs/WritingAnLLVMPass.rst')
-rw-r--r--llvm/docs/WritingAnLLVMPass.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/docs/WritingAnLLVMPass.rst b/llvm/docs/WritingAnLLVMPass.rst
index 241066842b7..4e5f8a90a93 100644
--- a/llvm/docs/WritingAnLLVMPass.rst
+++ b/llvm/docs/WritingAnLLVMPass.rst
@@ -525,6 +525,14 @@ interface. Implementing a loop pass is usually straightforward.
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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OpenPOWER on IntegriCloud