Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
-
7f15bd15
by Samuel Thibault at 2026-01-12T07:16:25-05:00
-
1db2f240
by Andrew Lelechenko at 2026-01-12T07:17:06-05:00
-
e038a383
by Sven Tennie at 2026-01-12T07:17:49-05:00
-
be3829a4
by sheaf at 2026-01-12T12:56:25-05:00
-
9f61ac3b
by fendor at 2026-01-12T12:56:25-05:00
6 changed files:
- .gitignore
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs
- libraries/base/src/Data/Bifoldable1.hs
- libraries/ghc-platform/src/GHC/Platform/ArchOS.hs
- utils/ghc-pkg/Main.hs
Changes:
| ... | ... | @@ -256,3 +256,12 @@ ghc.nix/ |
| 256 | 256 | # clangd
|
| 257 | 257 | .clangd
|
| 258 | 258 | dist-newstyle/
|
| 259 | + |
|
| 260 | +# -----------------------------------------------------------------------------
|
|
| 261 | +# CI
|
|
| 262 | + |
|
| 263 | +# Windows CI
|
|
| 264 | +toolchain/
|
|
| 265 | +ghc-*/
|
|
| 266 | +inplace/
|
|
| 267 | +tmp/ |
| ... | ... | @@ -406,7 +406,7 @@ linearRA block_live block_id = go [] [] |
| 406 | 406 | -- | Do allocation for a single instruction.
|
| 407 | 407 | raInsn
|
| 408 | 408 | :: OutputableRegConstraint freeRegs instr
|
| 409 | - => BlockMap Regs -- ^ map of what vregs are love on entry to each block.
|
|
| 409 | + => BlockMap Regs -- ^ map of what vregs are live on entry to each block.
|
|
| 410 | 410 | -> [instr] -- ^ accumulator for instructions already processed.
|
| 411 | 411 | -> BlockId -- ^ the id of the current block, for debugging
|
| 412 | 412 | -> LiveInstr instr -- ^ the instr to have its regs allocated, with liveness info.
|
| ... | ... | @@ -37,7 +37,11 @@ data StackMap |
| 37 | 37 | |
| 38 | 38 | -- See Note [UniqFM and the register allocator]
|
| 39 | 39 | -- | Assignment of vregs to stack slots.
|
| 40 | - , stackMapAssignment :: UniqFM Unique StackSlot }
|
|
| 40 | + --
|
|
| 41 | + -- We record not just the slot, but also how many stack slots the vreg
|
|
| 42 | + -- takes up, in order to avoid re-using a stack slot for a register
|
|
| 43 | + -- that has grown but already had a stack slot (#26668).
|
|
| 44 | + , stackMapAssignment :: UniqFM Unique (StackSlot, Int) }
|
|
| 41 | 45 | |
| 42 | 46 | |
| 43 | 47 | -- | An empty stack map, with all slots available.
|
| ... | ... | @@ -50,14 +54,19 @@ emptyStackMap = StackMap 0 emptyUFM |
| 50 | 54 | --
|
| 51 | 55 | getStackSlotFor :: StackMap -> Format -> Unique -> (StackMap, Int)
|
| 52 | 56 | |
| 53 | -getStackSlotFor fs@(StackMap _ reserved) _fmt regUnique
|
|
| 54 | - | Just slot <- lookupUFM reserved regUnique = (fs, slot)
|
|
| 55 | - |
|
| 56 | -getStackSlotFor (StackMap freeSlot reserved) fmt regUnique =
|
|
| 57 | - let
|
|
| 58 | - nbSlots = (formatInBytes fmt + 7) `div` 8
|
|
| 59 | - in
|
|
| 60 | - (StackMap (freeSlot+nbSlots) (addToUFM reserved regUnique freeSlot), freeSlot)
|
|
| 57 | +getStackSlotFor fs@(StackMap freeSlot reserved) fmt regUnique
|
|
| 58 | + -- The register already has a stack slot; try to re-use it.
|
|
| 59 | + | Just (slot, nbSlots) <- lookupUFM reserved regUnique
|
|
| 60 | + -- Make sure the slot is big enough for this format, in case the register
|
|
| 61 | + -- has grown (#26668).
|
|
| 62 | + , nbNeededSlots <= nbSlots
|
|
| 63 | + = (fs, slot)
|
|
| 64 | + | otherwise
|
|
| 65 | + = (StackMap (freeSlot+nbNeededSlots) (addToUFM reserved regUnique (freeSlot, nbNeededSlots)), freeSlot)
|
|
| 66 | + -- NB: this can create fragmentation if a register keeps growing.
|
|
| 67 | + -- That's probably OK, as this is only happens very rarely.
|
|
| 68 | + where
|
|
| 69 | + !nbNeededSlots = (formatInBytes fmt + 7) `div` 8
|
|
| 61 | 70 | |
| 62 | 71 | -- | Return the number of stack slots that were allocated
|
| 63 | 72 | getStackUse :: StackMap -> Int
|
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | -- Copyright: Edward Kmett, Oleg Grenrus
|
| 3 | 3 | -- License: BSD-3-Clause
|
| 4 | 4 | --
|
| 5 | +-- @since 4.18.0.0
|
|
| 5 | 6 | |
| 6 | 7 | {-# LANGUAGE NoImplicitPrelude #-}
|
| 7 | 8 | {-# LANGUAGE Safe #-}
|
| ... | ... | @@ -156,7 +156,7 @@ stringEncodeOS = \case |
| 156 | 156 | OSHaiku -> "haiku"
|
| 157 | 157 | OSQNXNTO -> "nto-qnx"
|
| 158 | 158 | OSAIX -> "aix"
|
| 159 | - OSHurd -> "hurd"
|
|
| 159 | + OSHurd -> "gnu"
|
|
| 160 | 160 | OSWasi -> "wasi"
|
| 161 | 161 | OSGhcjs -> "ghcjs"
|
| 162 | 162 |
| ... | ... | @@ -23,7 +23,6 @@ |
| 23 | 23 | |
| 24 | 24 | module Main (main) where
|
| 25 | 25 | |
| 26 | -import Debug.Trace
|
|
| 27 | 26 | import qualified GHC.Unit.Database as GhcPkg
|
| 28 | 27 | import GHC.Unit.Database hiding (mkMungePathUrl)
|
| 29 | 28 | import GHC.HandleEncoding
|
| ... | ... | @@ -1634,7 +1633,7 @@ listPackages verbosity my_flags mPackageName mModuleName = do |
| 1634 | 1633 | simplePackageList :: [Flag] -> [InstalledPackageInfo] -> IO ()
|
| 1635 | 1634 | simplePackageList my_flags pkgs = do
|
| 1636 | 1635 | let showPkg :: InstalledPackageInfo -> String
|
| 1637 | - showPkg | FlagShowUnitIds `elem` my_flags = traceId . display . installedUnitId
|
|
| 1636 | + showPkg | FlagShowUnitIds `elem` my_flags = display . installedUnitId
|
|
| 1638 | 1637 | | FlagNamesOnly `elem` my_flags = display . mungedName . mungedId
|
| 1639 | 1638 | | otherwise = display . mungedId
|
| 1640 | 1639 | strs = map showPkg pkgs
|