Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve PhiFunctionFixer performance #430

Merged
merged 2 commits into from
Aug 21, 2024
Merged
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
4 changes: 2 additions & 2 deletions decompiler/pipeline/preprocessing/phi_predecessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def run(self, task: DecompilerTask):
self.cfg = task.graph
self.head = task.graph.root
self._def_map, self._use_map = _init_maps(self.cfg)
self._basic_block_of_definition = _init_basicblocks_of_definition(self.cfg)
self.extend_phi_functions()

def extend_phi_functions(self):
Expand Down Expand Up @@ -77,10 +78,9 @@ def _basicblocks_of_used_variables_in_phi_function(
each key is the variable that is defined at the node
"""
variable_definition_nodes: Dict[BasicBlock, Variable] = dict()
basic_block_of_definition = _init_basicblocks_of_definition(self.cfg)
for variable in used_variables:
if self._def_map.get(variable):
node_with_variable_definition = basic_block_of_definition[variable]
node_with_variable_definition = self._basic_block_of_definition[variable]
else:
node_with_variable_definition = None if is_head else self.head
if node_with_variable_definition not in variable_definition_nodes.keys():
Expand Down
Loading