@@ -321,15 +321,14 @@ def _finalize_specific(self):
321321 raise RuntimeError ("error registering OpenMP offloading descriptor" )
322322
323323
324- class CustomFunctionCompiler (_FunctionCompiler ):
325- def _customize_flags (self , flags ):
326- # We need to disable SSA form for OpenMP analysis to detect variables
327- # used within regions.
324+ class CustomCompiler (compiler .CompilerBase ):
325+ def __init__ (self , typingctx , targetctx , library , args , return_type , flags , locals ):
326+ # Ensure SSA form is disabled for OpenMP analysis to detect variables used within regions.
328327 flags .enable_ssa = False
329- return flags
330-
328+ super ().__init__ (
329+ typingctx , targetctx , library , args , return_type , flags , locals
330+ )
331331
332- class CustomCompiler (compiler .CompilerBase ):
333332 @staticmethod
334333 def custom_untyped_pipeline (state , name = "untyped-openmp" ):
335334 """Returns an untyped part of the nopython OpenMP pipeline"""
@@ -366,14 +365,15 @@ def custom_untyped_pipeline(state, name="untyped-openmp"):
366365 pm .add_pass (FindLiterallyCalls , "find literally calls" )
367366 pm .add_pass (LiteralUnroll , "handles literal_unroll" )
368367
369- if state .flags .enable_ssa :
370- assert False , "SSA form is not supported in OpenMP"
368+ assert not state .flags .enable_ssa , (
369+ "SSA form is not supported in OpenMP compilation"
370+ )
371371
372372 pm .add_pass (LiteralPropagationSubPipelinePass , "Literal propagation" )
373- # Run WithLifting late to for make_implicit_explicit to work. TODO: We
374- # should create a pass that does this instead of replicating and hacking
375- # the untyped pipeline. This handling may also negatively affect
376- # optimizations.
373+ # Run WithLifting late to for make_implicit_explicit to work.
374+ # TODO: We should create a pass that does this instead of replicating
375+ # and hacking the untyped pipeline. This handling may also negatively
376+ # affect optimizations.
377377 pm .add_pass (WithLifting , "Handle with contexts" )
378378
379379 pm .finalize ()
0 commit comments