mlton icon indicating copy to clipboard operation
mlton copied to clipboard

Eliminate tuples from IR and use datatypes instead

Open jasoncarr0 opened this issue 6 years ago • 0 comments

With the split types pass, non-interfering usages of datatypes become distinct datatypes. Code was added for https://github.com/MLton/mlton/pull/288 that performs an analysis of datatype size, and such code is often quite cheap to run (since the set of datatypes is so small) in practice.

As such, it would be beneficial to remove Tuples from the representations. This has a couple benefits:

  • Simplifies SSA and SSA2 representations and passes
  • Enables optimizations on de-facto tuples and other small datatypes that were previously only performed for bona fide tuple types.
  • Globalizes and names information about tuple structures, improving the speed of datatype analysis, as well as reading, writing and type-checking the IR.

jasoncarr0 avatar Aug 15 '19 16:08 jasoncarr0