[Chapel Merge] Use PassManager in addInitGuards, localizeGlobals,

Branch: refs/heads/main
Revision: 11b6d28
Author: aconsroe-hpe
Link: Use PassManager in addInitGuards, localizeGlobals, bulkCopyRecords, and removeUnnecessaryAutoCopyCalls by aconsroe-hpe · Pull Request #19273 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19273 from aconsroe-hpe/passmanager-3

Use PassManager in addInitGuards, localizeGlobals, bulkCopyRecords, and removeUnnecessaryAutoCopyCalls

reviewed by @dlongnecke-cray

Continues #19164

This begins a refactor on passes in addInitGuards, localizeGlobals, bulkCopyRecords, and removeUnnecessaryAutoCopyCalls. See commits for more commentary on a per-pass basis, but generally my approach was:

  1. isolate the use of the global ast vecs
  2. convert file statics into class statics
  3. convert forv_* as appropriate (see #19240 for why this is complicated)
  4. leave comments about other global state that could be an issue

As ever, this is an active WIP so I feel okay leaving so many comments because I anticipate answering a lot of the questions as the PassManager effort progresses.

Testing

  • [x] paratest

  • [x] paratest with --fast

  • [x] paratest with comm

    Modified Files:
    M compiler/include/passes.h
    M compiler/optimizations/bulkCopyRecords.cpp
    M compiler/optimizations/localizeGlobals.cpp
    M compiler/optimizations/removeUnnecessaryAutoCopyCalls.cpp
    M compiler/passes/addInitGuards.cpp
    M compiler/passes/normalize.cpp

    Compare: Comparing 0694aaddd64d...11b6d2844d50 · chapel-lang/chapel · GitHub