Skip to content

Commit

Permalink
Update remove-if to eliminate-dead-code (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirDroubi authored Oct 18, 2023
1 parent f95b40f commit f2442fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/composed_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ def vectorize(

# Now that we have a tail loop, the conditional in the main loop
# can be removed
proc = remove_if(proc, inner_loop_cursor.body()[0])
proc = eliminate_dead_code(proc, inner_loop_cursor.body()[0])

proc = vectorize_to_loops(
proc, tail_loop_cursor, vec_width, memory_type, precision
Expand Down
4 changes: 2 additions & 2 deletions src/level1/asum.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def asum(n: size, x: [f32][n] @ DRAM, result: f32 @ DRAM):
def schedule_asum_stride_1(asum, params):
asum = generate_stride_1_proc(asum, params.precision)

if not isinstance(params.mem_type, AVX2):
if params.mem_type is not AVX2:
return asum

loop = asum.find_loop("i")
Expand All @@ -52,7 +52,7 @@ def schedule_asum_stride_1(asum, params):

loop = asum.forward(loop)
asum = cut_loop(asum, loop, FormattedExprStr("_ - 1", loop.hi()))
asum = remove_if(asum, loop.body()[0].body()[0])
asum = eliminate_dead_code(asum, loop.body()[0].body()[0])
asum = auto_stage_mem(asum, asum.find("x[_]"), "xReg")
asum = stage_expr(asum, asum.find("select(_)"), "selectReg")
asum = simplify(asum)
Expand Down

0 comments on commit f2442fe

Please sign in to comment.