Skip to content
Snippets Groups Projects
  1. Nov 13, 2013
    • Chandler Carruth's avatar
      Introduce an AnalysisManager which is like a pass manager but with a lot · 74015a70
      Chandler Carruth authored
      more smarts in it. This is where most of the interesting logic that used
      to live in the implicit-scheduling-hackery of the old pass manager will
      live.
      
      Like the previous commits, note that this is a very early prototype!
      I expect substantial changes before this is ready to use.
      
      The core of the design is the following:
      
      - We have an AnalysisManager which can be used across a series of
        passes over a module.
      - The code setting up a pass pipeline registers the analyses available
        with the manager.
      - Individual transform passes can check than an analysis manager
        provides the analyses they require in order to fail-fast.
      - There is *no* implicit registration or scheduling.
      - Analysis passes are different from other passes: they produce an
        analysis result that is cached and made available via the analysis
        manager.
      - Cached results are invalidated automatically by the pass managers.
      - When a transform pass requests an analysis result, either the analysis
        is run to produce the result or a cached result is provided.
      
      There are a few aspects of this design that I *know* will change in
      subsequent commits:
      - Currently there is no "preservation" system, that needs to be added.
      - All of the analysis management should move up to the analysis library.
      - The analysis management needs to support at least SCC passes. Maybe
        loop passes. Living in the analysis library will facilitate this.
      - Need support for analyses which are *both* module and function passes.
      - Need support for pro-actively running module analyses to have cached
        results within a function pass manager.
      - Need a clear design for "immutable" passes.
      - Need support for requesting cached results when available and not
        re-running the pass even if that would be necessary.
      - Need more thorough testing of all of this infrastructure.
      
      There are other aspects that I view as open questions I'm hoping to
      resolve as I iterate a bit on the infrastructure, and especially as
      I start writing actual passes against this.
      - Should we have separate management layers for function, module, and
        SCC analyses? I think "yes", but I'm not yet ready to switch the code.
        Adding SCC support will likely resolve this definitively.
      - How should the 'require' functionality work? Should *that* be the only
        way to request results to ensure that passes always require things?
      - How should preservation work?
      - Probably some other things I'm forgetting. =]
      
      Look forward to more patches in shorter order now that this is in place.
      
      llvm-svn: 194538
      74015a70
  2. Nov 09, 2013
    • Chandler Carruth's avatar
      Move the old pass manager infrastructure into a legacy namespace and · 7caea415
      Chandler Carruth authored
      give the files a legacy prefix in the right directory. Use forwarding
      headers in the old locations to paper over the name change for most
      clients during the transitional period.
      
      No functionality changed here! This is just clearing some space to
      reduce renaming churn later on with a new system.
      
      Even when the new stuff starts to go in, it is going to be hidden behind
      a flag and off-by-default as it is still WIP and under development.
      
      This patch is specifically designed so that very little out-of-tree code
      has to change. I'm going to work as hard as I can to keep that the case.
      Only direct forward declarations of the PassManager class are impacted
      by this change.
      
      llvm-svn: 194324
      7caea415
  3. Sep 19, 2013
  4. Jul 03, 2013
  5. May 05, 2013
  6. Apr 03, 2013
  7. Feb 26, 2013
  8. Feb 06, 2013
  9. Jan 02, 2013
    • Chandler Carruth's avatar
      Move all of the header files which are involved in modelling the LLVM IR · 9fb823bb
      Chandler Carruth authored
      into their new header subdirectory: include/llvm/IR. This matches the
      directory structure of lib, and begins to correct a long standing point
      of file layout clutter in LLVM.
      
      There are still more header files to move here, but I wanted to handle
      them in separate commits to make tracking what files make sense at each
      layer easier.
      
      The only really questionable files here are the target intrinsic
      tablegen files. But that's a battle I'd rather not fight today.
      
      I've updated both CMake and Makefile build systems (I think, and my
      tests think, but I may have missed something).
      
      I've also re-sorted the includes throughout the project. I'll be
      committing updates to Clang, DragonEgg, and Polly momentarily.
      
      llvm-svn: 171366
      9fb823bb
    • Chandler Carruth's avatar
      Rename VMCore directory to IR. · ef860a24
      Chandler Carruth authored
      Aside from moving the actual files, this patch only updates the build
      system and the source file comments under lib/... that are relevant.
      
      I'll be updating other docs and other files in smaller subsequnet
      commits.
      
      While I've tried to test this, but it is entirely possible that there
      will still be some build system fallout.
      
      Also, note that I've not changed the library name itself: libLLVMCore.a
      is still the library name. I'd be interested in others' opinions about
      whether we should rename this as well (I think we should, just not sure
      what it might break)
      
      llvm-svn: 171359
      ef860a24
  10. Dec 05, 2012
    • Pedro Artigas's avatar
      · 41b98843
      Pedro Artigas authored
      - Added calls to doInitialization/doFinalization to immutable passes
      - fixed ordering of calls to doFinalization to be the reverse of the pass run order due to potential dependencies
      - fixed machine module info to operate in the doInitialization/doFinalization model, also fixes some FIXMEs
      
      reviewed by Evan Cheng <evan.cheng@apple.com>
      
      llvm-svn: 169391
      41b98843
  11. Dec 03, 2012
  12. Dec 01, 2012
  13. Nov 30, 2012
  14. Nov 29, 2012
  15. Nov 27, 2012
    • Owen Anderson's avatar
      Revert r168635 "Step towards implementation of pass manager with... · 1db12f51
      Owen Anderson authored
      Revert r168635 "Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model".
      It appears to have broken at least one buildbot.
      
      llvm-svn: 168654
      1db12f51
    • Owen Anderson's avatar
      Step towards implementation of pass manager with doInitialization and... · 336368c4
      Owen Anderson authored
      Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model
      
      Patch by Pedro Artigas, with feedback from by Chandler Carruth.
      
      llvm-svn: 168635
      336368c4
  16. Nov 26, 2012
    • Zhou Sheng's avatar
      Fix a PassManager pointer use-after-free bug. · c1cf629e
      Zhou Sheng authored
      The bug can be triggered when we require LoopInfo analysis ahead of DominatorTree construction in a Module Pass. The cause is that the LoopInfo analysis itself also invokes DominatorTree construction, therefore, when PassManager schedules LoopInfo, it will add DominatorTree first. Then after that, when the PassManger turns to schedule DominatorTree invoked by the above ModulePass, it finds there is already a DominatorTree, so it delete the redundant one. However, somehow it still try to access that pass pointer after free as code pasted below, which results in segment fault.
      
      llvm-svn: 168581
      c1cf629e
  17. Nov 15, 2012
  18. Nov 13, 2012
  19. Nov 12, 2012
  20. Sep 27, 2012
  21. Sep 06, 2012
  22. Jul 18, 2012
  23. May 14, 2012
  24. Mar 23, 2012
  25. Feb 05, 2012
  26. Feb 01, 2012
    • Andrew Trick's avatar
      Add pass printer passes in the right place. · cbc845f9
      Andrew Trick authored
      The pass pointer should never be referenced after sending it to
      schedulePass(), which may delete the pass. To fix this bug I had to
      clean up the design leading to more goodness.
      
      You may notice now that any non-analysis pass is printed. So things like loop-simplify and lcssa show up, while target lib, target data, alias analysis do not show up. Normally, analysis don't mutate the IR, but you can now check this by using both -print-after and -print-before. The effects of analysis will now show up in between the two.
      
      The llc path is still in bad shape. But I'll be improving it in my next checkin. Meanwhile, print-machineinstrs still works the same way. With print-before/after, many llc passes that were not printed before now are, some of these should be converted to analysis. A few very important passes, isel and scheduler, are not properly initialized, so not printed.
      
      llvm-svn: 149480
      cbc845f9
  27. Dec 20, 2011
  28. Oct 16, 2011
  29. Sep 13, 2011
  30. Aug 29, 2011
Loading