From ec3b8471a6549f46e36b0e601041b835b18cdc3f Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 8 Oct 2025 20:52:47 +0200 Subject: Simplify: Don't forget effects, again This didn't actually result in any test failures, but I caught it while hunting for a bug that turned out to be missing scaleMany in the new occCount. --- src/Simplify.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Simplify.hs b/src/Simplify.hs index 28b6d60..ac1570b 100644 --- a/src/Simplify.hs +++ b/src/Simplify.hs @@ -200,12 +200,12 @@ simplify'Rec = \case EMaybe ext (ESnd ext e1) (ESnd ext e2) e3 -- TODO: more array indexing - EIdx _ (EBuild _ _ _ e1) e2 -> acted $ simplify' $ elet e2 e1 - EIdx _ (EReplicate1Inner _ _ e2) e3 -> acted $ simplify' $ EIdx ext e2 (EFst ext e3) - EIdx _ (EUnit _ e1) _ -> acted $ simplify' $ e1 + EIdx _ (EBuild _ _ e1 e2) e3 | not (hasAdds e1) -> acted $ simplify' $ elet e3 e2 + EIdx _ (EReplicate1Inner _ e1 e2) e3 | not (hasAdds e1) -> acted $ simplify' $ EIdx ext e2 (EFst ext e3) + EIdx _ (EUnit _ e1) e2 | not (hasAdds e2) -> acted $ simplify' $ e1 -- TODO: more array shape - EShape _ (EBuild _ _ e _) -> acted $ simplify' e + EShape _ (EBuild _ _ e1 e2) | not (hasAdds e2) -> acted $ simplify' e1 -- TODO: more constant folding EOp _ OIf (EConst _ STBool True) -> acted $ return (EInl ext STNil (ENil ext)) -- cgit v1.2.3-70-g09d2