Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions projects/eudsl-python-extras/mlir/extras/runtime/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ def acc_compute_lowering(self, device_type: "mlir::acc::DeviceType" = None):
return self

def acc_declare_ctor_dtor_conversion(
self, priority: int = None, generate_dtors: bool = None
self,
priority: int = None,
generate_dtors: bool = None,
extra_ctor_name: str = None,
extra_constructors: List[str] = None,
entry_only_constructors: List[str] = None,
entry_point_name: str = None,
):
"""Convert OpenACC declare global constructors and destructors to LLVM functions

Expand All @@ -96,10 +102,21 @@ def acc_declare_ctor_dtor_conversion(
Args:
priority: Priority for ACC declare global constructors and destructors
generate_dtors: Generate LLVM destructor functions and register them globally
extra_ctor_name: Name of the extra constructor function added to global ctors.
extra_constructors: Extra functions to declare and call from an OpenACC constructor.
entry_only_constructors: Extra functions to declare and call from an OpenACC constructor when the entry-point-name is defined and present in the module
entry_point_name: Symbol name of the entry point. Extra constructors with in entryOnlyConstructors are emitted only when this symbol is present. Empty means entryOnlyConstructors are never emitted.
"""
self.add_pass(
"acc-declare-ctor-dtor-conversion",
**{"priority": priority, "generate-dtors": generate_dtors}
**{
"priority": priority,
"generate-dtors": generate_dtors,
"extra-ctor-name": extra_ctor_name,
"extra-constructors": extra_constructors,
"entry-only-constructors": entry_only_constructors,
"entry-point-name": entry_point_name,
}
)
return self

Expand Down Expand Up @@ -4682,6 +4699,9 @@ def remove_dead_values(self, canonicalize: bool = None):
(D) Removes simple and region branch ops that have all non-live results and
don't affect memory in any way.

The pass applies only to nested operations. It preserves the root
operation, including its operands, results, and function signature.

Here, a "simple op" refers to an op that isn't a symbol op, symbol-user op,
region branch op, branch op, region branch terminator op, or return-like.

Expand Down
24 changes: 22 additions & 2 deletions projects/mlir-python-mcp/mlir_python_mcp/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ def acc_compute_lowering(self, device_type: "mlir::acc::DeviceType" = None):
return self

def acc_declare_ctor_dtor_conversion(
self, priority: int = None, generate_dtors: bool = None
self,
priority: int = None,
generate_dtors: bool = None,
extra_ctor_name: str = None,
extra_constructors: List[str] = None,
entry_only_constructors: List[str] = None,
entry_point_name: str = None,
):
"""Convert OpenACC declare global constructors and destructors to LLVM functions

Expand All @@ -96,10 +102,21 @@ def acc_declare_ctor_dtor_conversion(
Args:
priority: Priority for ACC declare global constructors and destructors
generate_dtors: Generate LLVM destructor functions and register them globally
extra_ctor_name: Name of the extra constructor function added to global ctors.
extra_constructors: Extra functions to declare and call from an OpenACC constructor.
entry_only_constructors: Extra functions to declare and call from an OpenACC constructor when the entry-point-name is defined and present in the module
entry_point_name: Symbol name of the entry point. Extra constructors with in entryOnlyConstructors are emitted only when this symbol is present. Empty means entryOnlyConstructors are never emitted.
"""
self.add_pass(
"acc-declare-ctor-dtor-conversion",
**{"priority": priority, "generate-dtors": generate_dtors}
**{
"priority": priority,
"generate-dtors": generate_dtors,
"extra-ctor-name": extra_ctor_name,
"extra-constructors": extra_constructors,
"entry-only-constructors": entry_only_constructors,
"entry-point-name": entry_point_name,
}
)
return self

Expand Down Expand Up @@ -4682,6 +4699,9 @@ def remove_dead_values(self, canonicalize: bool = None):
(D) Removes simple and region branch ops that have all non-live results and
don't affect memory in any way.

The pass applies only to nested operations. It preserves the root
operation, including its operands, results, and function signature.

Here, a "simple op" refers to an op that isn't a symbol op, symbol-user op,
region branch op, branch op, region branch terminator op, or return-like.

Expand Down
2 changes: 1 addition & 1 deletion third_party/llvm-project
Submodule llvm-project updated 2236 files
Loading