Skip to content

Simplifier does not preserve dependency ordering of the program

I noticed this some time ago, but I thought this is expected, because there's a comment in CoreLint that mentions this:

lintCoreBindings dflags pass local_in_scope binds
  = initL dflags flags in_scope_set $
    addLoc TopLevelBindings         $
    lintLetBndrs TopLevel binders   $
        -- Put all the top-level binders in scope at the start
        -- This is because transformation rules can bring something
        -- into use 'unexpectedly'
    ...

However talking to SPJ today he mentioned that in Core we should actually preserve dependency ordering, hence this ticket.

I'll update with a reproducer.

Trac metadata
Trac field Value
Version 8.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information