reduceNonRepPrim
potentially introduces illegal variables
#974
Labels
reduceNonRepPrim
potentially introduces illegal variables
#974
Consider the primitive reduction of
map
:clash-compiler/clash-lib/src/Clash/Normalize/PrimitiveReductions.hs
Lines 141 to 171 in 33047ee
extractElems
is called withis0
: theInScopeSet
of the current transformation. Given the pseudocode:the primitive reduction might generate:
This is incorrect as
reduceNonRepPrim
is potentially followed by anappProp
:clash-compiler/clash-lib/src/Clash/Normalize.hs
Lines 355 to 363 in fc8beb3
appProp
has an invariant assuming:clash-compiler/clash-lib/src/Clash/Normalize/Transformations.hs
Lines 1095 to 1097 in 02616d7
reduceNonRepPrim
should therefore make sure it doesn't introduce any new variables already mentioned in the body offun1
(as well as the "normal" in scope set).The text was updated successfully, but these errors were encountered: