summaryrefslogtreecommitdiff
path: root/src/Simplify.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simplify.hs')
-rw-r--r--src/Simplify.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Simplify.hs b/src/Simplify.hs
index 66a4004..d3ee03c 100644
--- a/src/Simplify.hs
+++ b/src/Simplify.hs
@@ -121,6 +121,11 @@ simplify' = \case
EIdx _ a b -> EIdx ext <$> simplify' a <*> simplify' b
EShape _ e -> EShape ext <$> simplify' e
EOp _ op e -> EOp ext op <$> simplify' e
+ ECustom _ s t a b c e1 e2 ->
+ ECustom ext s t <$> (let ?accumInScope = False in simplify' a)
+ <*> (let ?accumInScope = False in simplify' b)
+ <*> (let ?accumInScope = False in simplify' c)
+ <*> simplify' e1 <*> simplify' e2
EWith e1 e2 -> EWith <$> simplify' e1 <*> (let ?accumInScope = True in simplify' e2)
EAccum i e1 e2 e3 -> EAccum i <$> simplify' e1 <*> simplify' e2 <*> simplify' e3
EZero t -> pure $ EZero t
@@ -160,6 +165,7 @@ hasAdds = \case
ESum1Inner _ e -> hasAdds e
EUnit _ e -> hasAdds e
EReplicate1Inner _ a b -> hasAdds a || hasAdds b
+ ECustom _ _ _ a b c d e -> hasAdds a || hasAdds b || hasAdds c || hasAdds d || hasAdds e
EConst _ _ _ -> False
EIdx0 _ e -> hasAdds e
EIdx1 _ a b -> hasAdds a || hasAdds b