Skip to content

Commit

Permalink
Add pass manager to run InstrinsicsOpenMP pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ggeorgakoudis committed Aug 13, 2021
1 parent 957016c commit d739445
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions numba/core/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@ def _optimize_final_module(self):
"""
Internal: optimize this library's final module.
"""
with self._codegen._intrinsics_openmp_pass_manager() as pm:
pm.run(self._final_module)

# there is an issue in xmain when optimizing functions twice. openmp Todd
with self._codegen._function_pass_manager(self._final_module) as fpm:
# Run function-level optimizations to reduce memory usage and improve
Expand Down Expand Up @@ -1240,6 +1243,11 @@ def _module_pass_manager(self, **kwargs):
pm.add_refprune_pass(_parse_refprune_flags())
return pm

def _intrinsics_openmp_pass_manager(self):
pm = ll.create_module_pass_manager()
pm.add_intrinsics_openmp_pass()
return pm

def _function_pass_manager(self, llvm_module, **kwargs):
pm = ll.create_function_pass_manager(llvm_module)
self._tm.add_analysis_passes(pm)
Expand Down

0 comments on commit d739445

Please sign in to comment.