proc_rmdead: use explicit pattern set when there are no wildcards
authorZachary Snow <zach@zachjs.com>
Wed, 28 Jul 2021 21:34:24 +0000 (17:34 -0400)
committerZachary Snow <zachary.j.snow@gmail.com>
Fri, 30 Jul 2021 00:55:59 +0000 (20:55 -0400)
commitc016f6a4236fb970196f35c2afb0f2c7c237a77f
tree6d7902946f6a5b662217fbd2d9a63a513c10e70c
parent4fec3a85cd7d0fcd35f958bfc89090df25f7de3c
proc_rmdead: use explicit pattern set when there are no wildcards

If width of a case expression was large, explicit patterns could cause
the existing logic to take an extremely long time, or exhaust the
maximum size of the underlying set. For cases where all of the patterns
are fully defined and there are no constants in the case expression,
this change uses a simple set to track which patterns have been seen.
passes/proc/proc_rmdead.cc
tests/proc/rmdead.v [new file with mode: 0644]
tests/proc/rmdead.ys [new file with mode: 0644]
tests/simple/case_large.v [new file with mode: 0644]