Commits on Source (17)
-
We now have `cloneBndrs` and `cloneRecIdBndrs` which take a `UniqSupply` argument, and `cloneBndrsM` and `cloneRecIdBndrsM` which rather have a `MonadUnique` constraint.
583fc267 -
Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns).
25681b60 -
Make the list of variables to use in generated code `Infinite`, to avoid panicking on the (now impossible) empty list case.
1b017761 -
Make the list of available names `Infinite`, to avoid panicking on the (now impossible) empty list case.
773ce0f5 -
We do so by changing the type of `BlockContext` to statically (in GHC) exclude the possibility of Cmm statics, and using `NonEmpty` lists of `BlockContext`s in `cmmDebugGen`.
6fe0e844 -
We do so by introducing `mkLitNumberWrap'` whose ultimate codomain is `Integer` rather than `Literal`, and then use that rather than `mkLitNumberWrap` where we just need the number rather than the `Literal`.
363e13f5 -
- Match the vector element list only once in `shuffleInstructions`. - Define `isSuitableFloatingPointLit_maybe` which returns `Just` the width if the lit is indeed suitable.
3303bedf -
At some sites, we merely panic if the `[]` or `Maybe` is empty when we convert to `NonEmpty` or `Identity`, but at least now we make it explicit. At other sites, we are able to use more precise types and avoid the partiality altogether. To do so, we redefine various functions to operate over `Traversable` arguments, so we can use the appropriate shape where known.
91fc805c -
4c444441
-
59337372
-
Fixes #25615.
34fb39b3 -
Previously we assumed that all unlifted types were `Addr#` but this isn't true. As noted in #25638, unlifted nullary data constructor workers can also appear at the top-level and are obviously not of type `Addr#`. Note that there is more work to be done to properly handle unlifted data constructors (especially nullary; see #25636). However, this is a small step in the right direction. Closes #25641.
805ed7c4 -
We currently do not support top-level unlifted data constructor applications, therefore this is a safe assertion. Pointed out by @sheaf.
4bee43b8 -
Closes #25654.
e5259b46 -
SLIDE x 0 is a no-op as it means to shift x elements of the stack by no spaces. In the interpreter, this results in a loop which copies an array element into the same place. I have instrumented GHCi to count how many of these instructions are interpreted. The workload was `ghc` compiling two simple modules. Total no-op slides: 7793476 Total slides: 11413289 Percentage useless (slides): 68% Percentage uselss of total instructions: 9%
91833c0b
Showing
- .gitlab-ci.yml 1 addition, 0 deletions.gitlab-ci.yml
- compiler/GHC/Cmm/DebugBlock.hs 58 additions, 45 deletionscompiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/MachOp.hs 4 additions, 3 deletionscompiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/ThreadSanitizer.hs 2 additions, 2 deletionscompiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/Cmm/Utils.hs 5 additions, 11 deletionscompiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs 37 additions, 31 deletionscompiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/CFG.hs 1 addition, 1 deletioncompiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/CmmToAsm/PPC/Instr.hs 2 additions, 4 deletionscompiler/GHC/CmmToAsm/PPC/Instr.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs 11 additions, 13 deletionscompiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs 3 additions, 6 deletionscompiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs 2 additions, 3 deletionscompiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs 4 additions, 8 deletionscompiler/GHC/CmmToAsm/Reg/Liveness.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs 28 additions, 33 deletionscompiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs 12 additions, 12 deletionscompiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core/Make.hs 11 additions, 6 deletionscompiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/ConstantFold.hs 3 additions, 3 deletionscompiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/SetLevels.hs 48 additions, 37 deletionscompiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs 3 additions, 3 deletionscompiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs 2 additions, 2 deletionscompiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs 26 additions, 27 deletionscompiler/GHC/Core/Opt/SpecConstr.hs