diff options
author | Bartosz Nitka <niteria@gmail.com> | 2017-09-19 14:31:38 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2017-09-19 14:31:38 -0700 |
commit | 6bc81c984eb11185d2df8e519f3b8b1410360ae7 (patch) | |
tree | dff6e06de6905ab9c0325ddfd726f3c0452f66d9 | |
parent | 7c7914d02a7ff189aba2f4feca31366fb4ab2664 (diff) | |
download | haskell-wip/smaller-minJumpTableSize.tar.gz |
[Experiment] Try minJumpTableSize = 3wip/smaller-minJumpTableSize
Summary:
I want to see gipeda results
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Blame Revision:
-rw-r--r-- | compiler/cmm/CmmSwitch.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/cmm/CmmSwitch.hs b/compiler/cmm/CmmSwitch.hs index 53d00de95a..f252cafa39 100644 --- a/compiler/cmm/CmmSwitch.hs +++ b/compiler/cmm/CmmSwitch.hs @@ -66,9 +66,9 @@ maxJumpTableHole = 7 -- | Minimum size of a jump table. If the number is smaller, the switch is -- implemented using conditionals. --- Currently 5, because an if-then-else tree of 4 values is nice and compact. +-- Currently 3, because that's the heuristic GCC and clang seem to use minJumpTableSize :: Int -minJumpTableSize = 5 +minJumpTableSize = 3 -- | Minimum non-zero offset for a jump table. See Note [Jump Table Offset]. minJumpTableOffset :: Integer @@ -302,7 +302,7 @@ splitAtHoles holeSize m = map (\range -> restrictMap range m) nonHoles -- (into singleton maps, for now). breakTooSmall :: M.Map Integer a -> [M.Map Integer a] breakTooSmall m - | M.size m > minJumpTableSize = [m] + | M.size m >= minJumpTableSize = [m] | otherwise = [M.singleton k v | (k,v) <- M.toList m] --- |