comparison docs/AliasAnalysis.rst @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 54457678186b
children 7d135dc70f03
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
284 that you do override, in code paths that return a conservative MayAlias or 284 that you do override, in code paths that return a conservative MayAlias or
285 Mod/Ref result, simply return whatever the superclass computes. For example: 285 Mod/Ref result, simply return whatever the superclass computes. For example:
286 286
287 .. code-block:: c++ 287 .. code-block:: c++
288 288
289 AliasAnalysis::AliasResult alias(const Value *V1, unsigned V1Size, 289 AliasResult alias(const Value *V1, unsigned V1Size,
290 const Value *V2, unsigned V2Size) { 290 const Value *V2, unsigned V2Size) {
291 if (...) 291 if (...)
292 return NoAlias; 292 return NoAlias;
293 ... 293 ...
294 294
295 // Couldn't determine a must or no-alias result. 295 // Couldn't determine a must or no-alias result.
387 keep an AliasAnalysis consistent, however there's no way for a pass to declare 387 keep an AliasAnalysis consistent, however there's no way for a pass to declare
388 in its ``getAnalysisUsage`` that it does so. Some passes attempt to use 388 in its ``getAnalysisUsage`` that it does so. Some passes attempt to use
389 ``AU.addPreserved<AliasAnalysis>``, however this doesn't actually have any 389 ``AU.addPreserved<AliasAnalysis>``, however this doesn't actually have any
390 effect. 390 effect.
391 391
392 ``AliasAnalysisCounter`` (``-count-aa``) and ``AliasDebugger`` (``-debug-aa``) 392 ``AliasAnalysisCounter`` (``-count-aa``) are implemented as ``ModulePass``
393 are implemented as ``ModulePass`` classes, so if your alias analysis uses 393 classes, so if your alias analysis uses ``FunctionPass``, it won't be able to
394 ``FunctionPass``, it won't be able to use these utilities. If you try to use 394 use these utilities. If you try to use them, the pass manager will silently
395 them, the pass manager will silently route alias analysis queries directly to 395 route alias analysis queries directly to ``BasicAliasAnalysis`` instead.
396 ``BasicAliasAnalysis`` instead.
397 396
398 Similarly, the ``opt -p`` option introduces ``ModulePass`` passes between each 397 Similarly, the ``opt -p`` option introduces ``ModulePass`` passes between each
399 pass, which prevents the use of ``FunctionPass`` alias analysis passes. 398 pass, which prevents the use of ``FunctionPass`` alias analysis passes.
400 399
401 The ``AliasAnalysis`` API does have functions for notifying implementations when 400 The ``AliasAnalysis`` API does have functions for notifying implementations when