mirror of
https://github.com/anoma/juvix.git
synced 2024-12-13 11:16:48 +03:00
235d88f303
* Closes #1614 * Implements the copy propagation transformation in JuvixReg and adds tests for it. * For this optimization to give any improvement, we need to run dead code elimination afterwards (#2827).
23 lines
609 B
Haskell
23 lines
609 B
Haskell
module Reg.Transformation.SSA where
|
|
|
|
import Base
|
|
import Juvix.Compiler.Reg.Transformation
|
|
import Juvix.Compiler.Reg.Transformation.SSA
|
|
import Reg.Parse.Positive qualified as Parse
|
|
import Reg.Transformation.Base
|
|
|
|
allTests :: TestTree
|
|
allTests = testGroup "SSA" (map liftTest $ Parse.filterOutTests ["Test039: Copy & constant propagation"] Parse.tests)
|
|
|
|
pipe :: [TransformationId]
|
|
pipe = [SSA]
|
|
|
|
liftTest :: Parse.PosTest -> TestTree
|
|
liftTest _testRun =
|
|
fromTest
|
|
Test
|
|
{ _testTransformations = pipe,
|
|
_testAssertion = \tab -> unless (checkSSA tab) $ error "check SSA",
|
|
_testRun
|
|
}
|