Skip to content

Commit

Permalink
Remove unused config option flexible_lifetime_start
Browse files Browse the repository at this point in the history
  • Loading branch information
hanno-becker committed Jul 29, 2024
1 parent d254f45 commit 5b4c09a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
8 changes: 0 additions & 8 deletions slothy/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,6 @@ def split_heuristic_estimate_performance(self):
"read config.split_heuristic_estimate_performance otherwise.")
return self._split_heuristic_estimate_performance

@property
def flexible_lifetime_start(self):
"""Internal property indicating whether the lifetime interval of a register
should be allowed to extend _before_ the instructions which uses it."""
return \
self.constraints.maximize_register_lifetimes or \
(self.sw_pipelining.enabled and self.sw_pipelining.allow_post)

@property
def split_heuristic_repeat(self):
"""If split_heuristic is enabled, the number of times the splitting heuristic
Expand Down
23 changes: 8 additions & 15 deletions slothy/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2210,16 +2210,12 @@ def make_start_var(name=""):
for t in self._get_nodes(allnodes=True):
# When we optimize for longest register lifetimes, we allow the starting time of the
# usage interval to be smaller than the program order position of the instruction.
if self.config.flexible_lifetime_start:
t.out_lifetime_start = [
make_start_var(f"{t.varname()}_out_{i}_lifetime_start")
for i in range(t.inst.num_out) ]
t.inout_lifetime_start = [
make_start_var(f"{t.varname()}_inout_{i}_lifetime_start")
for i in range(t.inst.num_in_out) ]
else:
t.out_lifetime_start = [ t.program_start_var for _ in range(t.inst.num_out) ]
t.inout_lifetime_start = [ t.program_start_var for _ in range(t.inst.num_in_out) ]
t.out_lifetime_start = [
make_start_var(f"{t.varname()}_out_{i}_lifetime_start")
for i in range(t.inst.num_out) ]
t.inout_lifetime_start = [
make_start_var(f"{t.varname()}_inout_{i}_lifetime_start")
for i in range(t.inst.num_in_out) ]

t.out_lifetime_end = [ make_var(f"{t.varname()}_out_{i}_lifetime_end")
for i in range(t.inst.num_out) ]
Expand Down Expand Up @@ -2474,11 +2470,8 @@ def _add_basic_constraints(start_list, end_list):
# Make sure the output argument is considered 'used' for at least
# one instruction. Otherwise, instructions producing outputs that
# are never used would be able to overwrite life registers.
self._Add( end_var > t.program_start_var )

# cf add_variables_dependencies()
if self.config.flexible_lifetime_start:
self._Add(start_var <= t.program_start_var)
self._Add(end_var > t.program_start_var)
self._Add(start_var == t.program_start_var)

_add_basic_constraints(t.out_lifetime_start, t.out_lifetime_end)
_add_basic_constraints(t.inout_lifetime_start, t.inout_lifetime_end)
Expand Down

0 comments on commit 5b4c09a

Please sign in to comment.