diff options
author | U-Maokai\andi <C:\Users\andi\AppData\Roaming\The Bat!> | 2018-01-26 15:43:13 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-01-26 15:43:25 -0500 |
commit | 7ff6023537fdef32bbe9b4c357012d705d9b931f (patch) | |
tree | d6e61c9af9433ebd516def8a3edc042d926943a7 /hadrian/src/Rules/Library.hs-boot | |
parent | 59fa7b32b018a91f81773ca676251a0b2761ef56 (diff) | |
download | haskell-7ff6023537fdef32bbe9b4c357012d705d9b931f.tar.gz |
cmm: Use two equality checks for two alt switch with default
For code like:
f 1 = e1
f 7 = e2
f _ = e3
We can treat it as a sparse jump table, check if we are outside of the
range in one direction first and then start checking the values.
GHC currently does this by checking for x>7, then x <= 7 and at last x
== 1.
This patch changes this such that we only compare for equality against
the two values and jump to the default if non are equal.
The resulting code is both faster and smaller.
wheel-sieve1 improves by 4-8% depending on problem size.
This implements the idea from #14644
Reviewers: bgamari, simonmar, simonpj, nomeata
Reviewed By: simonpj, nomeata
Subscribers: nomeata, simonpj, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4294
Diffstat (limited to 'hadrian/src/Rules/Library.hs-boot')
0 files changed, 0 insertions, 0 deletions