Skip to content

Commit

Permalink
Move ShareZeroVec later in SSA simplify order
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFluet committed Oct 20, 2017
1 parent e51acf9 commit 87cb78a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mlton/ssa/simplify.fun
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(* Copyright (C) 2009 Matthew Fluet.
(* Copyright (C) 2009,2017 Matthew Fluet.
* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
Expand Down Expand Up @@ -63,7 +63,6 @@ val ssaPassesDefault =
{name = "loopUnroll1", doit = LoopUnroll.transform, execute = false} ::
{name = "removeUnused2", doit = RemoveUnused.transform, execute = true} ::
{name = "simplifyTypes", doit = SimplifyTypes.transform, execute = true} ::
{name = "shareZeroVec", doit = ShareZeroVec.transform, execute = true} ::
(* polyEqual should run
* - after types are simplified so that many equals are turned into eqs
* - before inlining so that equality functions can be inlined
Expand Down Expand Up @@ -97,6 +96,16 @@ val ssaPassesDefault =
{name = "commonArg", doit = CommonArg.transform, execute = true} ::
{name = "commonSubexp1", doit = CommonSubexp.transform, execute = true} ::
{name = "commonBlock", doit = CommonBlock.transform, execute = true} ::
(* shareZeroVec should run
* - after useless because sharing of zero-length array inhibits
* changing type of flow-disjoint vector data
* - after simplifyTypes because it may make previously distinct
* types equal and allow more sharing of zero-length arrays
* - after inlining because shareZeroVec (slightly) increases size
* - before redundantTests because shareZeroVec introduces
* comparisons with zero
*)
{name = "shareZeroVec", doit = ShareZeroVec.transform, execute = true} ::
{name = "redundantTests", doit = RedundantTests.transform, execute = true} ::
{name = "redundant", doit = Redundant.transform, execute = true} ::
{name = "loopUnswitch2", doit = LoopUnswitch.transform, execute = false} ::
Expand Down

0 comments on commit 87cb78a

Please sign in to comment.