summaryrefslogtreecommitdiff
path: root/compiler/GHC/Llvm
Commit message (Collapse)AuthorAgeFilesLines
* Refactor handling of global initializersBen Gamari2022-04-012-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | GHC uses global initializers for a number of things including cost-center registration, info-table provenance registration, and setup of foreign exports. Previously, the global initializer arrays which referenced these initializers would live in the object file of the C stub, which would then be merged into the main object file of the module. Unfortunately, this approach is no longer tenable with the move to Clang/LLVM on Windows (see #21019). Specifically, lld's PE backend does not support object merging (that is, the -r flag). Instead we are now rather packaging a module's object files into a static library. However, this is problematic in the case of initializers as there are no references to the C stub object in the archive, meaning that the linker may drop the object from the final link. This patch refactors our handling of global initializers to instead place initializer arrays within the object file of the module to which they belong. We do this by introducing a Cmm data declaration containing the initializer array in the module's Cmm stream. While the initializer functions themselves remain in separate C stub objects, the reference from the module's object ensures that they are not dropped from the final link. In service of #21068.
* Introduce alignment to CmmStoreBen Gamari2022-02-042-9/+10
|
* Introduce alignment in CmmLoadBen Gamari2022-02-042-13/+9
|
* CmmToLlvm: rename LCGConfig -> LlvmCgConfigdoyougnu2021-12-141-52/+52
| | | | | | | | | | | | | | | | | | | | CmmToLlvm: renamce lcgPlatform -> llvmCgPlatform CmmToLlvm: rename lcgContext -> llvmCgContext CmmToLlvm: rename lcgFillUndefWithGarbage CmmToLlvm: rename lcgSplitSections CmmToLlvm: lcgBmiVersion -> llvmCgBmiVersion CmmToLlvm: lcgLlvmVersion -> llvmCgLlvmVersion CmmToLlvm: lcgDoWarn -> llvmCgDoWarn CmmToLlvm: lcgLlvmConfig -> llvmCgLlvmConfig CmmToLlvm: llvmCgPlatformMisc --> llvmCgLlvmTarget
* SysTools.Tasks Llvm.Types: remove redundant importdoyougnu2021-12-141-1/+0
| | | | | | | | Llvm.Types: remove redundant import SysTools.Tasks: remove redundant import - namely CmmToLlvm.Base
* CmmToLlvm: Remove DynFlags, add LlvmCgConfigdoyougnu2021-12-142-67/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CodeOutput: LCGConfig, add handshake initLCGConfig Add two modules: GHC.CmmToLlvm.Config -- to hold the Llvm code gen config GHC.Driver.Config.CmmToLlvm -- for initialization, other utils CmmToLlvm: remove HasDynFlags, add LlvmConfig CmmToLlvm: add lcgContext to LCGConfig CmmToLlvm.Base: DynFlags --> LCGConfig Llvm: absorb LlvmOpts into LCGConfig CmmToLlvm.Ppr: swap DynFlags --> LCGConfig CmmToLlvm.CodeGen: swap DynFlags --> LCGConfig CmmToLlvm.CodeGen: swap DynFlags --> LCGConfig CmmToLlvm.Data: swap LlvmOpts --> LCGConfig CmmToLlvm: swap DynFlags --> LCGConfig CmmToLlvm: move LlvmVersion to CmmToLlvm.Config Additionally: - refactor Config and initConfig to hold LlvmVersion - push IO needed to get LlvmVersion to boundary between Cmm and LLvm code generation - remove redundant imports, this is much cleaner! CmmToLlvm.Config: store platformMisc_llvmTarget instead of all of platformMisc
* Remove useless {-# LANGUAGE CPP #-} pragmasSylvain Henry2021-05-122-2/+2
|
* Fully remove HsVersions.hSylvain Henry2021-05-122-4/+0
| | | | | | | | | | Replace uses of WARN macro with calls to: warnPprTrace :: Bool -> SDoc -> a -> a Remove the now unused HsVersions.h Bump haddock submodule
* Replace (ptext .. sLit) with `text`Sylvain Henry2021-04-292-19/+18
| | | | | | | | | | | | | | | 1. `text` is as efficient as `ptext . sLit` thanks to the rewrite rules 2. `text` is visually nicer than `ptext . sLit` 3. `ptext . sLit` encourages using one `ptext` for several `sLit` as in: ptext $ case xy of ... -> sLit ... ... -> sLit ... which may allocate SDoc's TextBeside constructors at runtime instead of sharing them into CAFs.
* CmmToLlvm: Sign/Zero extend parameters for foreign callsStefan Schulze Frielinghaus2021-01-171-10/+20
| | | | | | | | For some architectures the C calling convention is that any integer shorter than 64 bits is replaced by its 64 bits representation using sign or zero extension. Fixes #19023.
* Lint the compiler for extraneous LANGUAGE pragmasHécate2020-10-102-2/+1
|
* DynFlags: disentangle OutputableSylvain Henry2020-08-122-0/+2
| | | | | | | | | - put panic related functions into GHC.Utils.Panic - put trace related functions using DynFlags in GHC.Driver.Ppr One step closer making Outputable fully independent of DynFlags. Bump haddock submodule
* Clean up haddock hyperlinks of GHC.* (part2)Takenobu Tani2020-06-251-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | This updates haddock comments only. This patch focuses to update for hyperlinks in GHC API's haddock comments, because broken links especially discourage newcomers. This includes the following hierarchies: - GHC.Iface.* - GHC.Llvm.* - GHC.Rename.* - GHC.Tc.* - GHC.HsToCore.* - GHC.StgToCmm.* - GHC.CmmToAsm.* - GHC.Runtime.* - GHC.Unit.* - GHC.Utils.* - GHC.SysTools.*
* DynFlags refactoring VIII (#17957)Sylvain Henry2020-06-133-263/+288
| | | | | | | | | | | * Remove several uses of `sdocWithDynFlags`, especially in GHC.Llvm.* * Add LlvmOpts datatype to store Llvm backend options * Remove Outputable instances (for LlvmVar, LlvmLit, LlvmStatic and Llvm.MetaExpr) which require LlvmOpts. * Rename ppMetaExpr into ppMetaAnnotExpr (pprMetaExpr is now used in place of `ppr :: MetaExpr -> SDoc`)
* Modules: Utils and Data (#13009)Sylvain Henry2020-04-264-9/+9
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Kill wORDS_BIGENDIAN and replace it with platformByteOrder (#17957)Sylvain Henry2020-04-011-32/+33
| | | | | | Metric Decrease: T13035 T1969
* Modules: Types (#13009)Sylvain Henry2020-03-293-3/+3
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Refactoring: use Platform instead of DynFlags when possibleSylvain Henry2020-03-192-53/+59
| | | | | | | | Metric Decrease: ManyConstructors T12707 T13035 T1969
* Modules: CmmToAsm (#13009)Sylvain Henry2020-02-241-1/+1
|
* Modules: Driver (#13009)Sylvain Henry2020-02-211-1/+1
| | | | submodule updates: nofib, haddock
* Disentangle DynFlags and SDocSylvain Henry2020-02-202-8/+6
| | | | | | | | | | | | | Remove several uses of `sdocWithDynFlags`. The remaining ones are mostly CodeGen related (e.g. depend on target platform constants) and will be fixed separately. Metric Decrease: T12425 T9961 WWRec T1969 T14683
* Modules: Llvm (#13009)Sylvain Henry2020-02-184-0/+1834