[DSLX:ir_conv] IR convert trailing match arms w/ multiple patterns.#1921
Conversation
f8c7e9c to
8804cca
Compare
|
Rebased this, PTAL. |
|
@cdleary do we want to also update the existing examples to remove unnecessary trailing match clause w/ wildcards? |
|
@proppy Yeah I'd think so, can't think of a reason why not -- I did a quick search for |
|
found at least one :) xls/xls/examples/jpeg/idct_chen.x Line 239 in 6f68726 but I was also wondering if we should make this a failure/warning during conversion? |
@proppy This is a warning https://sourcegraph.com/github.com/google/xls/-/blob/xls/dslx/warning_kind.h?L45 already-exhaustive-match , it's just disabled by default so Google-internal codebase can do the global change that enables it by default. In my repo I have a toolchain-level config that enables it by default. |
Previously we would give an IR conversion error, which was a vestige from where we needed the trailing arm to be a wildcard. Now with exhaustiveness we know the trailing match arm must be usable as a default case in the priority select that we lower to.