Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Add a dead code removal pass right before finishing Parallel IR. This…
Browse files Browse the repository at this point in the history
… fixes a bug with range.jl and ranges.jl.
  • Loading branch information
DrTodd13 committed Sep 16, 2016
1 parent 6c90164 commit 8f40c11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/parallel-ir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ function from_lambda_body(body :: Expr, depth, state)
CompilerTools.LambdaHandling.updateAssignedDesc(state.LambdaVarInfo, cas.symbol_assigns)

body = CompilerTools.LambdaHandling.eliminateUnusedLocals!(state.LambdaVarInfo, body, ParallelAccelerator.ParallelIR.AstWalk)
@dprintln(3,"After eliminating unused locals = ", state.LambdaVarInfo)
CompilerTools.LambdaHandling.stripCaptureFlag(state.LambdaVarInfo)

return body
Expand Down Expand Up @@ -3197,13 +3198,19 @@ function from_root(function_name, ast)
#assert(length(ast) == 1)
#body = body[1]

@dprintln(1,"Final ParallelIR function = ", function_name, " body = ")
@dprintln(1,"After from_expr function = ", function_name, " body = ")
printLambda(1, LambdaVarInfo, body)

body = remove_extra_allocs(LambdaVarInfo, body)

set_pir_stats(body)

lives = computeLiveness(body, LambdaVarInfo)
body = AstWalk(body, remove_dead, RemoveDeadState(lives))

@dprintln(1,"Final ParallelIR function = ", function_name, " body = ")
printLambda(1, LambdaVarInfo, body)

#if pir_stop != 0
# throw(string("STOPPING AFTER PARALLEL IR CONVERSION"))
#end
Expand Down

0 comments on commit 8f40c11

Please sign in to comment.