1. 29 Apr, 2017 1 commit
  2. 06 Jul, 2016 1 commit
  3. 27 Jan, 2016 1 commit
    • rwbarton's avatar
      Test for undef bugs in the LLVM backend when validating · d50609e8
      rwbarton authored
      In an attempt to catch bugs involving using undef values, replace
      undef literals by values likely to cause crashes or test failures.
      We do this only when validating since it is a deoptimization.
      
      This depends on D1857 to catch such bugs in the RTS (such as #11487).
      
      Test Plan:
      Did a build with
      ```
      BuildFlavour = quick-llvm
      SRC_HC_OPTS_STAGE1 = -fllvm-fill-undef-with-garbage
      ```
      The build crashed when running ghc-stage2, as expected.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1858
      d50609e8
  4. 13 Oct, 2015 1 commit
    • Erik de Castro Lopo's avatar
      Switch to LLVM version 3.7 · 29310b62
      Erik de Castro Lopo authored
      Before this commit, GHC only supported LLVM 3.6. Now it only supports
      LLVM 3.7 which was released in August 2015. LLVM version 3.6 and earlier
      do not work on AArch64/Arm64, but 3.7 does.
      
      Also:
      * Add CC_Ghc constructor to LlvmCallConvention.
      * Replace `maxSupportLlvmVersion`/`minSupportLlvmVersion` with
        a single `supportedLlvmVersion` variable.
      * Get `supportedLlvmVersion` from version specified in configure.ac.
      * Drop llvmVersion field from DynFlags (no longer needed because only
        one version is supported).
      
      Test Plan: Validate on x86_64 and arm
      
      Reviewers: bgamari, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1320
      
      GHC Trac Issues: #10953
      29310b62
  5. 09 Oct, 2015 2 commits
  6. 02 Oct, 2015 1 commit
  7. 04 Jul, 2015 1 commit
    • Michal Terepeta's avatar
      Support MO_{Add,Sub}IntC and MO_Add2 in the LLVM backend · b1d1c652
      Michal Terepeta authored
      This includes:
      
      - Adding new LlvmType called LMStructP that represents an unpacked
        struct (this is necessary since LLVM's instructions the
        llvm.sadd.with.overflow.* return an unpacked struct).
      
      - Modifications to LlvmCodeGen.CodeGen to generate the LLVM
        instructions for the primops.
      
      - Modifications to StgCmmPrim to actually use those three instructions
        if we use the LLVM backend (so far they were only used for NCG).
      
      Test Plan: validate
      
      Reviewers: austin, rwbarton, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D991
      
      GHC Trac Issues: #9430
      b1d1c652
  8. 21 Nov, 2014 1 commit
    • Ben Gamari's avatar
      llvmGen: Compatibility with LLVM 3.5 (re #9142) · e16a342d
      Ben Gamari authored
      Due to changes in LLVM 3.5 aliases now may only refer to definitions.
      Previously to handle symbols defined outside of the current commpilation
      unit GHC would emit both an `external` declaration, as well as an alias
      pointing to it, e.g.,
      
          @stg_BCO_info = external global i8
          @stg_BCO_info$alias = alias private i8* @stg_BCO_info
      
      Where references to `stg_BCO_info` will use the alias
      `stg_BCO_info$alias`. This is not permitted under the new alias
      behavior, resulting in errors resembling,
      
          Alias must point to a definition
          i8* @"stg_BCO_info$alias"
      
      To fix this, we invert the naming relationship between aliases and
      definitions. That is, now the symbol definition takes the name
      `@stg_BCO_info$def` and references use the actual name, `@stg_BCO_info`.
      This means the external symbols can be handled by simply emitting an
      `external` declaration,
      
          @stg_BCO_info = external global i8
      
      Whereas in the case of a forward declaration we emit,
      
          @stg_BCO_info = alias private i8* @stg_BCO_info$def
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D155
      e16a342d
  9. 15 May, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add LANGUAGE pragmas to compiler/ source files · 23892440
      Herbert Valerio Riedel authored
      In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
      reorganized, while following the convention, to
      
      - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
        any `{-# OPTIONS_GHC #-}`-lines.
      
      - Moreover, if the list of language extensions fit into a single
        `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
        line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
        individual language extension. In both cases, try to keep the
        enumeration alphabetically ordered.
        (The latter layout is preferable as it's more diff-friendly)
      
      While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
      occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
      23892440
  10. 27 Jun, 2013 7 commits
    • Peter Wortmann's avatar
      Major Llvm refactoring · a948fe83
      Peter Wortmann authored
      This combined patch reworks the LLVM backend in a number of ways:
      
      1. Most prominently, we introduce a LlvmM monad carrying the contents of
         the old LlvmEnv around. This patch completely removes LlvmEnv and
         refactors towards standard library monad combinators wherever possible.
      
      2. Support for streaming - we can now generate chunks of Llvm for Cmm as
         it comes in. This might improve our speed.
      
      3. To allow streaming, we need a more flexible way to handle forward
         references. The solution (getGlobalPtr) unifies LlvmCodeGen.Data
         and getHsFunc as well.
      
      4. Skip alloca-allocation for registers that are actually never written.
         LLVM will automatically eliminate these, but output is smaller and
         friendlier to human eyes this way.
      
      5. We use LlvmM to collect references for llvm.used. This allows places
         other than cmmProcLlvmGens to generate entries.
      a948fe83
    • Peter Wortmann's avatar
      Use full contents size for arrays · fa6cbdfb
      Peter Wortmann authored
      I am not quite sure at what point it makes sense to look at arrays as
      pointers, but I ran into at least one use case that strongly suggested
      doing it this way (calculating the actual size of structures, to be exact).
      fa6cbdfb
    • Peter Wortmann's avatar
      Extend globals to aliases · 720a87c7
      Peter Wortmann authored
      Also give them a proper constructor - getGlobalVar and getGlobalValue
      map directly to the accessors.
      720a87c7
    • Peter Wortmann's avatar
      Use SDoc for all LLVM pretty-printing · 99d39221
      Peter Wortmann authored
      This patch reworks some parts of the LLVM pretty-printing code that were
      still using Show and String. Now we should be using SDoc and Outputable
      throughout. Note that many get*Name functions become pp*Name
      here as a side-effect.
      99d39221
    • Peter Wortmann's avatar
      Iteration on dterei's metadata design · 12148d91
      Peter Wortmann authored
      - MetaArgs is not needed, as variables are already meta data
      
      - Same goes for MetaVal - its only reason for existing seems to be to
        support LLVM's strange pretty-printing for meta-data annotations, and
        I feel that is better to keep the data structure clean and handle it in
        the pretty-printing instead.
      
      - Rename "MetaData" to "MetaAnnot". Meta-data is still meta-data when it
        is not associated with an expression or statement - for example compile
        unit data for debugging. I feel the old name was a bit misleading.
      
      - Make the renamed MetaAnnot a proper data type instead of a type alias
        for a pair.
      
      - Rename "MetaExpr" constructor to "MetaStruct". As the data is much more
        like a LLVM structure (not array, as it can contain values).
      
      - Fix a warning
      12148d91
    • dterei's avatar
      3b1d920e
    • dterei's avatar
      280a7ec6
  11. 01 Feb, 2013 1 commit
  12. 17 Jan, 2013 1 commit
  13. 16 Sep, 2012 2 commits
  14. 18 Jan, 2012 1 commit
  15. 12 Jan, 2012 1 commit
  16. 06 Jul, 2011 1 commit
  17. 20 Jul, 2010 1 commit
  18. 13 Jul, 2010 1 commit
  19. 07 Jul, 2010 3 commits
  20. 05 Jul, 2010 2 commits
  21. 28 Jun, 2010 1 commit
  22. 25 Jun, 2010 1 commit
  23. 24 Jun, 2010 1 commit
  24. 22 Jun, 2010 1 commit
  25. 21 Jun, 2010 2 commits
  26. 18 Jun, 2010 1 commit
    • dterei's avatar
      Add support of TNTC to llvm backend · 24a3fee9
      dterei authored
      We do this through a gnu as feature called subsections,
      where you can put data/code into a numbered subsection
      and those subsections will be joined together in descending
      order by gas at compile time.
      24a3fee9
  27. 15 Jun, 2010 1 commit