[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 11 commits: Define TICKY_TICKY when compiling cmm RTS files.

Marge Bot gitlab at gitlab.haskell.org
Fri Sep 11 18:01:24 UTC 2020



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
1bd28931 by David Himmelstrup at 2020-09-11T09:59:43-04:00
Define TICKY_TICKY when compiling cmm RTS files.

- - - - -
15e67801 by David Himmelstrup at 2020-09-11T09:59:43-04:00
Fix typos in TICKY_TICKY symbol names.

- - - - -
8a5a91cb by David Himmelstrup at 2020-09-11T09:59:43-04:00
Enable TICKY_TICKY for debug builds when building with makefiles.

- - - - -
3dc3b554 by Sandy Maguire at 2020-09-11T14:01:15-04:00
Add clamp function to Data.Ord

- - - - -
24e151d5 by Sandy Maguire at 2020-09-11T14:01:15-04:00
Add tests

- - - - -
09baaae5 by Ben Gamari at 2020-09-11T14:01:15-04:00
hadrian: Pass input file to makeindex

Strangely I find that on Alpine (and apparently only on Alpine) the
latex makeindex command expects to be given a filename, lest it reads
from stdin.

- - - - -
820c2ed6 by Ryan Scott at 2020-09-11T14:01:16-04:00
Don't quote argument to Hadrian's test-env flag (#18656)

Doing so causes the name of the test environment to gain an extra
set of double quotes, which changes the name entirely.

Fixes #18656.

- - - - -
822fb6e6 by Krzysztof Gogolewski at 2020-09-11T14:01:16-04:00
Make sure we can read past perf notes

See #18656.

- - - - -
b4496a44 by Ben Gamari at 2020-09-11T14:01:16-04:00
rts/win32: Fix missing #include's

These slipped through CI.

- - - - -
dcc95cb7 by Ben Gamari at 2020-09-11T14:01:16-04:00
Bump Win32 submodule to 2.9.0.0

Also bumps Cabal, directory

- - - - -
ecfa8b69 by Ben Gamari at 2020-09-11T14:01:16-04:00
Bump version to 9.0

(cherry picked from commit f218cfc92f7b1a1e01190851972bb9a0e0f3c682)

- - - - -


24 changed files:

- compiler/ghc.cabal.in
- configure.ac
- ghc/ghc-bin.cabal.in
- hadrian/src/Builder.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Packages.hs
- includes/Cmm.h
- includes/stg/Ticky.h
- libraries/Cabal
- libraries/base/Data/Ord.hs
- libraries/base/tests/all.T
- + libraries/base/tests/clamp.hs
- + libraries/base/tests/clamp.stdout
- libraries/directory
- libraries/haskeline
- mk/ways.mk
- rts/Ticky.c
- rts/win32/IOManager.c
- rts/win32/WorkQueue.c
- testsuite/driver/perf_notes.py
- utils/check-api-annotations/check-api-annotations.cabal
- utils/check-ppr/check-ppr.cabal
- utils/ghc-cabal/ghc-cabal.cabal
- utils/haddock


Changes:

=====================================
compiler/ghc.cabal.in
=====================================
@@ -77,7 +77,7 @@ Library
                    ghci == @ProjectVersionMunged@
 
     if os(windows)
-        Build-Depends: Win32  >= 2.3 && < 2.7
+        Build-Depends: Win32  >= 2.3 && < 2.10
     else
         if flag(terminfo)
             Build-Depends: terminfo == 0.4.*


=====================================
configure.ac
=====================================
@@ -13,7 +13,7 @@ dnl
 # see what flags are available. (Better yet, read the documentation!)
 #
 
-AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.11.0], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION])
+AC_INIT([The Glorious Glasgow Haskell Compilation System], [9.0.0], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION])
 
 # Set this to YES for a released version, otherwise NO
 : ${RELEASE=NO}


=====================================
ghc/ghc-bin.cabal.in
=====================================
@@ -45,7 +45,7 @@ Executable ghc
                    ghc        == @ProjectVersionMunged@
 
     if os(windows)
-        Build-Depends: Win32  >= 2.3 && < 2.7
+        Build-Depends: Win32  >= 2.3 && < 2.10
     else
         Build-Depends: unix   >= 2.7 && < 2.9
 
@@ -102,4 +102,4 @@ Executable ghc
     Default-Extensions:
         NoImplicitPrelude
       , ScopedTypeVariables
-      , BangPatterns
\ No newline at end of file
+      , BangPatterns


=====================================
hadrian/src/Builder.hs
=====================================
@@ -287,7 +287,7 @@ instance H.Builder Builder where
                   cmd' echo [path] "--no-split" [ "-o", output] [input]
 
                 Xelatex   -> unit $ cmd' [Cwd output] [path] buildArgs
-                Makeindex -> unit $ cmd' [Cwd output] [path] buildArgs
+                Makeindex -> unit $ cmd' [Cwd output] [path] (buildArgs ++ [input])
 
                 Tar _ -> cmd' buildOptions echo [path] buildArgs
                 _  -> cmd' echo [path] buildArgs


=====================================
hadrian/src/Settings/Builders/RunTest.hs
=====================================
@@ -142,7 +142,7 @@ runTestBuilderArgs = builder RunTest ? do
             , case perfBaseline of
                 Just commit | not (null commit) -> arg ("--perf-baseline=" ++ show commit)
                 _ -> mempty
-            , emitWhenSet testEnv $ \env -> arg ("--test-env=" ++ show env)
+            , emitWhenSet testEnv $ \env -> arg ("--test-env=" ++ env)
             , emitWhenSet testMetricsFile $ \file -> arg ("--metrics-file=" ++ file)
             , getTestArgs -- User-provided arguments from command line.
             ]


=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -279,7 +279,8 @@ rtsPackageArgs = package rts ? do
           , arg $ "-DFS_NAMESPACE=rts"
           , arg $ "-DCOMPILING_RTS"
           , notM targetSupportsSMP           ? arg "-DNOSMP"
-          , way `elem` [debug, debugDynamic] ? arg "-DTICKY_TICKY"
+          , way `elem` [debug, debugDynamic] ? pure [ "-DTICKY_TICKY"
+                                                    , "-optc-DTICKY_TICKY"]
           , Profiling `wayUnit` way          ? arg "-DPROFILING"
           , Threaded  `wayUnit` way          ? arg "-DTHREADED_RTS"
           , notM targetSupportsSMP           ? pure [ "-DNOSMP"


=====================================
includes/Cmm.h
=====================================
@@ -660,7 +660,11 @@
 #define TICK_BUMP(ctr)      TICK_BUMP_BY(ctr,1)
 
 #define TICK_ENT_DYN_IND()              TICK_BUMP(ENT_DYN_IND_ctr)
-#define TICK_ENT_DYN_THK()              TICK_BUMP(ENT_DYN_THK_ctr)
+// ENT_DYN_THK_ctr doesn't exist anymore. Could be ENT_DYN_THK_SINGLE_ctr or
+// ENT_DYN_THK_MANY_ctr
+// #define TICK_ENT_DYN_THK()              TICK_BUMP(ENT_DYN_THK_ctr)
+#define TICK_ENT_DYN_THK()
+
 #define TICK_ENT_VIA_NODE()             TICK_BUMP(ENT_VIA_NODE_ctr)
 #define TICK_ENT_STATIC_IND()           TICK_BUMP(ENT_STATIC_IND_ctr)
 #define TICK_ENT_PERM_IND()             TICK_BUMP(ENT_PERM_IND_ctr)


=====================================
includes/stg/Ticky.h
=====================================
@@ -199,18 +199,23 @@ EXTERN StgInt RET_UNBOXED_TUP_hst[TICKY_BIN_COUNT] INIT({0});
    TICKY_TICKY is defined or not. */
 
 #if !defined(CMINUSMINUS)
+#if defined(TICKY_TICKY)
 #define TICK_BUMP_BY(ctr,n) ctr = (StgInt) ctr + n
+#else
+#define TICK_BUMP_BY(ctr,n) /* nothing */
+#endif
+
 #define TICK_BUMP(ctr)      TICK_BUMP_BY(ctr,1)
 
-#define TICK_ALLOC_PRIM(x,y,z)
-#define TICK_UPD_OLD_IND()
-#define TICK_UPD_NEW_IND()
-#define TICK_UPD_SQUEEZED()
-#define TICK_ALLOC_HEAP_NOCTR(bytes)
-#define TICK_GC_FAILED_PROMOTION()
-#define TICK_ALLOC_TSO()
-#define TICK_ALLOC_STACK(g)
-#define TICK_ALLOC_UP_THK(g,s)
-#define TICK_ALLOC_SE_THK(g,s)
+#define TICK_ALLOC_PRIM(x,y,z)        // FIXME: update counter
+#define TICK_UPD_OLD_IND()            TICK_BUMP(UPD_OLD_IND_ctr)
+#define TICK_UPD_NEW_IND()            TICK_BUMP(UPD_NEW_IND_ctr)
+#define TICK_UPD_SQUEEZED()           TICK_BUMP(UPD_SQUEEZED_ctr)
+#define TICK_ALLOC_HEAP_NOCTR(bytes)  // FIXME: update counter
+#define TICK_GC_FAILED_PROMOTION()    // FIXME: update counter
+#define TICK_ALLOC_TSO()              // FIXME: update counter
+#define TICK_ALLOC_STACK(g)           // FIXME: update counter
+#define TICK_ALLOC_UP_THK(g,s)        // FIXME: update counter
+#define TICK_ALLOC_SE_THK(g,s)        // FIXME: update counter
 
 #endif


=====================================
libraries/Cabal
=====================================
@@ -1 +1 @@
-Subproject commit 32dad5c1cf70d65ecb93b0ec214445cf9c9f6615
+Subproject commit 2d8a1b60ae409291585b647be8f02bc42b23cbbb


=====================================
libraries/base/Data/Ord.hs
=====================================
@@ -21,6 +21,7 @@ module Data.Ord (
    Ordering(..),
    Down(..),
    comparing,
+   clamp,
  ) where
 
 import Data.Bits (Bits, FiniteBits)
@@ -44,6 +45,25 @@ import GHC.Show
 comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering
 comparing p x y = compare (p x) (p y)
 
+-- |
+-- > clamp (low, high) a = min high (max a low)
+--
+-- Function for ensursing the value @a@ is within the inclusive bounds given by
+-- @low@ and @high at . If it is, @a@ is returned unchanged. The result
+-- is otherwise @low@ if @a <= low@, or @high@ if @high <= a at .
+--
+-- When clamp is used at Double and Float, it has NaN propagating semantics in
+-- its second argument. That is, @clamp (l,h) NaN = NaN@, but @clamp (NaN, NaN)
+-- x = x at .
+--
+-- >>> clamp (0, 10) 2
+-- 2
+--
+-- >>> clamp ('a', 'm') 'x'
+-- 'm'
+clamp :: (Ord a) => (a, a) -> a -> a
+clamp (low, high) a = min high (max a low)
+
 -- | The 'Down' type allows you to reverse sort order conveniently.  A value of type
 -- @'Down' a@ contains a value of type @a@ (represented as @'Down' a@).
 -- If @a@ has an @'Ord'@ instance associated with it then comparing two


=====================================
libraries/base/tests/all.T
=====================================
@@ -256,3 +256,4 @@ test('T16943a', normal, compile_and_run, [''])
 test('T16943b', normal, compile_and_run, [''])
 test('T17499', [collect_stats('bytes allocated',5)], compile_and_run, ['-O -w'])
 test('T16643', normal, compile_and_run, [''])
+test('clamp', normal, compile_and_run, [''])


=====================================
libraries/base/tests/clamp.hs
=====================================
@@ -0,0 +1,28 @@
+import Data.Ord
+
+doClampInt :: (Int, Int) -> Int -> IO ()
+doClampInt bounds a = print $ clamp bounds a
+
+doClampFloat :: (Float, Float) -> Float -> IO ()
+doClampFloat bounds a = print $ clamp bounds a
+
+nan :: Float
+nan = 0 / 0
+
+main :: IO ()
+main = do
+  doClampInt (0, 100) 50       -- 50
+  doClampInt (0, 100) 200      -- 100
+  doClampInt (0, 100) (-5)     -- 0
+
+  doClampFloat (0, 100) 50     -- 50
+  doClampFloat (0, 100) 200    -- 100
+  doClampFloat (0, 100) (-5)   -- 0
+  doClampFloat (0, 100) nan    -- NaN
+  doClampFloat (nan, 100) 5    -- 5
+  doClampFloat (nan, 100) 105  -- 100
+  doClampFloat (5, nan) 105    -- 105
+  doClampFloat (5, nan) 3      -- 5
+
+  doClampFloat (nan, nan) 3    -- 3
+


=====================================
libraries/base/tests/clamp.stdout
=====================================
@@ -0,0 +1,12 @@
+50
+100
+0
+50.0
+100.0
+0.0
+NaN
+5.0
+100.0
+105.0
+5.0
+3.0


=====================================
libraries/directory
=====================================
@@ -1 +1 @@
-Subproject commit 3d9ca6edc0703860829ab3210db78bb4c4ff72b9
+Subproject commit c16afcda5708ee9944afa7ea6858e5be894fe67e


=====================================
libraries/haskeline
=====================================
@@ -1 +1 @@
-Subproject commit 5f16b76168f13c6413413386efc44fb1152048d5
+Subproject commit 0f8d5b73a0cbabea6d1b88a5fc2f06ea219a7bea


=====================================
mk/ways.mk
=====================================
@@ -70,7 +70,7 @@ WAY_thr_l_HC_OPTS= -static -optc-DTHREADED_RTS -eventlog
 
 # Way 'debug':
 WAY_debug_NAME=debug
-WAY_debug_HC_OPTS= -static -optc-DDEBUG -ticky -DTICKY_TICKY -eventlog
+WAY_debug_HC_OPTS= -static -optc-DDEBUG -ticky -DTICKY_TICKY -optc-DTICKY_TICKY -eventlog
 
 # Way 'debug_p':
 WAY_debug_p_NAME=debug profiled
@@ -110,7 +110,7 @@ WAY_thr_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DTHREADED_RTS -optc-DDEBUG -event
 
 # Way 'debug_dyn':
 WAY_debug_dyn_NAME=debug_dyn
-WAY_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DDEBUG -ticky -DTICKY_TICKY -eventlog
+WAY_debug_dyn_HC_OPTS=-fPIC -dynamic -optc-DDEBUG -ticky -DTICKY_TICKY -optc-DTICKY_TICKY -eventlog
 
 # Way 'l_dyn':
 WAY_l_dyn_NAME=event logging dynamic


=====================================
rts/Ticky.c
=====================================
@@ -261,7 +261,7 @@ PrintTickyInfo(void)
  *
  * This of course refers to the -ticky version that uses PERM_INDs to
  * determine the number of closures entered 0/1/>1.  KSW 1999-04.  */
-  COND_PR_CTR(ENT_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == false,"E!NT_PERM_IND_ctr requires +RTS -Z");
+  COND_PR_CTR(ENT_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == false,"ENT_PERM_IND_ctr requires +RTS -Z");
 
   PR_CTR(ENT_AP_ctr);
   PR_CTR(ENT_PAP_ctr);
@@ -334,10 +334,10 @@ PrintTickyInfo(void)
 
   PR_CTR(UPD_NEW_IND_ctr);
   /* see comment on ENT_PERM_IND_ctr */
-  COND_PR_CTR(UPD_NEW_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == false,"U!PD_NEW_PERM_IND_ctr requires +RTS -Z");
+  COND_PR_CTR(UPD_NEW_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == false,"UPD_NEW_PERM_IND_ctr requires +RTS -Z");
   PR_CTR(UPD_OLD_IND_ctr);
   /* see comment on ENT_PERM_IND_ctr */
-  COND_PR_CTR(UPD_OLD_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == false,"U!PD_OLD_PERM_IND_ctr requires +RTS -Z");
+  COND_PR_CTR(UPD_OLD_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == false,"UPD_OLD_PERM_IND_ctr requires +RTS -Z");
 
   PR_CTR(GC_SEL_ABANDONED_ctr);
   PR_CTR(GC_SEL_MINOR_ctr);


=====================================
rts/win32/IOManager.c
=====================================
@@ -11,6 +11,7 @@
 #if !defined(THREADED_RTS)
 
 #include "Rts.h"
+#include "RtsUtils.h"
 #include "IOManager.h"
 #include "WorkQueue.h"
 #include "ConsoleHandler.h"
@@ -440,7 +441,7 @@ AddIORequest ( int   fd,
 {
     ASSERT(ioMan);
 
-    WorkItem* wItem    = (WorkItem*)stgMallocBytse(sizeof(WorkItem), "AddIORequest");
+    WorkItem* wItem    = (WorkItem*)stgMallocBytes(sizeof(WorkItem), "AddIORequest");
 
     unsigned int reqID = ioMan->requestID++;
 


=====================================
rts/win32/WorkQueue.c
=====================================
@@ -4,6 +4,7 @@
  * (c) sof, 2002-2003.
  */
 #include "Rts.h"
+#include "RtsUtils.h"
 #include "WorkQueue.h"
 #include <stdbool.h>
 #include <stdio.h>


=====================================
testsuite/driver/perf_notes.py
=====================================
@@ -130,7 +130,13 @@ MetricOracles = NamedTuple("MetricOracles", [("baseline", MetricBaselineOracle),
 
 def parse_perf_stat(stat_str: str) -> PerfStat:
     field_vals = stat_str.strip('\t').split('\t')
-    return PerfStat(*field_vals) # type: ignore
+    stat = PerfStat(*field_vals) # type: ignore
+    if stat.test_env.startswith('"') and stat.test_env.endswith('"'):
+        # Due to a bug, in historical data sometimes the test_env
+        # contains additional quotation marks (#18656).
+        # Remove them, so that we can refer to past data in a uniform fashion.
+        stat = stat._replace(test_env=TestEnv(stat.test_env[1:-1]))
+    return stat
 
 # Get all recorded (in a git note) metrics for a given commit.
 # Returns an empty array if the note is not found.
@@ -662,6 +668,8 @@ def main() -> None:
         metrics = [test for test in metrics if test.stat.way == args.way]
 
     if args.test_env:
+        if '"' in args.test_env:
+            raise Exception('test_env should not contain quotation marks')
         metrics = [test for test in metrics if test.stat.test_env == args.test_env]
 
     if args.test_name:


=====================================
utils/check-api-annotations/check-api-annotations.cabal
=====================================
@@ -24,6 +24,6 @@ Executable check-api-annotations
 
     Build-Depends: base       >= 4   && < 5,
                    containers,
-                   Cabal      >= 3.0 && < 3.4,
+                   Cabal      >= 3.0 && < 3.6,
                    directory,
                    ghc


=====================================
utils/check-ppr/check-ppr.cabal
=====================================
@@ -25,7 +25,7 @@ Executable check-ppr
     Build-Depends: base       >= 4   && < 5,
                    bytestring,
                    containers,
-                   Cabal      >= 3.0 && < 3.4,
+                   Cabal      >= 3.0 && < 3.6,
                    directory,
                    filepath,
                    ghc


=====================================
utils/ghc-cabal/ghc-cabal.cabal
=====================================
@@ -21,6 +21,6 @@ Executable ghc-cabal
 
     Build-Depends: base       >= 3   && < 5,
                    bytestring >= 0.10 && < 0.11,
-                   Cabal      >= 3.0 && < 3.4,
+                   Cabal      >= 3.0 && < 3.6,
                    directory  >= 1.1 && < 1.4,
                    filepath   >= 1.2 && < 1.5


=====================================
utils/haddock
=====================================
@@ -1 +1 @@
-Subproject commit e514a52a496d1ec216568deec374872b4b5251a6
+Subproject commit b95f6f29899a8a58223732a6633a47a35b8f1d6a



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a38de0f2a41e81fe43bdb605a8f763bd9bdfe48c...ecfa8b69f69d76034e0fad56f22d241bd7a74692

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a38de0f2a41e81fe43bdb605a8f763bd9bdfe48c...ecfa8b69f69d76034e0fad56f22d241bd7a74692
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200911/0a8e9d79/attachment-0001.html>


More information about the ghc-commits mailing list