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

Update remove-if to eliminate-dead-code #29

Merged
merged 1 commit into from
Oct 18, 2023
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
2 changes: 1 addition & 1 deletion src/common/composed_schedules.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/level1/asum.py
Original file line number Diff line number Diff line change
@@ -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")
@@ -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)