Skip to content

Commit

Permalink
Dependencies from patterns are also important.
Browse files Browse the repository at this point in the history
In particular, with the memory representations, these might contain
references to memory blocks!
  • Loading branch information
athas committed Nov 2, 2023
1 parent 4f1386f commit 1726fb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Futhark/Analysis/DataDependencies.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ dataDependencies' startdeps = foldl grow startdeps . bodyStms
reductionDependencies deps lam' nes (depsOfArrays' shape arrs)
grow deps (Let pat _ (Op op)) =
let op_deps = map (depsOfNames deps) (opDependencies op)
in M.fromList (zip (patNames pat) op_deps) `M.union` deps
pat_deps = map (depsOfNames deps . freeIn) (patElems pat)
in M.fromList (zip (patNames pat) $ zipWith (<>) pat_deps op_deps)
`M.union` deps
grow deps (Let pat _ (Match c cases defbody _)) =
let cases_deps = map (dataDependencies' deps . caseBody) cases
defbody_deps = dataDependencies' deps defbody
Expand Down

0 comments on commit 1726fb1

Please sign in to comment.