mirror of
https://github.com/anoma/juvix.git
synced 2024-12-12 14:28:08 +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).
22 lines
505 B
Haskell
22 lines
505 B
Haskell
module Reg.Transformation.CopyPropagation where
|
|
|
|
import Base
|
|
import Juvix.Compiler.Reg.Transformation
|
|
import Reg.Parse.Positive qualified as Parse
|
|
import Reg.Transformation.Base
|
|
|
|
allTests :: TestTree
|
|
allTests = testGroup "Copy Propagation" (map liftTest Parse.tests)
|
|
|
|
pipe :: [TransformationId]
|
|
pipe = [CopyPropagation]
|
|
|
|
liftTest :: Parse.PosTest -> TestTree
|
|
liftTest _testRun =
|
|
fromTest
|
|
Test
|
|
{ _testTransformations = pipe,
|
|
_testAssertion = const (return ()),
|
|
_testRun
|
|
}
|