diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+## 5.0.0 (2017-09-07)
+
+* Support for LLVM 5.0
+
+    We only give a summary of the changes affecting the public API of `llvm-hs-pure` here.
+    Please refer to the official
+    [release notes for LLVM 5.0](http://releases.llvm.org/5.0.0/docs/ReleaseNotes.html)
+    for an overview of all changes in LLVM 5.0.
+
+    * The `X86_64_Win64` calling convention is now called `Win64`.
+    * There is a new `Speculatable` function attribute.
+    * The `CrossThread` synchronization scope has been removed. There is
+      now a new `System` synchronization scope.
+
 ## 4.1.0 (2017-05-17)
 
 * Switch AST to `ByteString`/`ShortByteString` reflecting LLVM’s use
diff --git a/llvm-hs-pure.cabal b/llvm-hs-pure.cabal
--- a/llvm-hs-pure.cabal
+++ b/llvm-hs-pure.cabal
@@ -1,5 +1,5 @@
 name: llvm-hs-pure
-version: 4.1.0.0
+version: 5.0.0
 license: BSD3
 license-file: LICENSE
 author: Anthony Cowley, Stephen Diehl, Moritz Kiefer <moritz.kiefer@purelyfunctional.org>, Benjamin S. Scarlet
@@ -22,7 +22,7 @@
 source-repository head
   type: git
   location: git://github.com/llvm-hs/llvm-hs.git
-  branch: llvm-4
+  branch: llvm-5
 
 flag semigroups
   description: Add semigroups to build-depends for Data.List.NonEmpty. This will be selected automatically by cabal.
diff --git a/src/LLVM/AST/CallingConvention.hs b/src/LLVM/AST/CallingConvention.hs
--- a/src/LLVM/AST/CallingConvention.hs
+++ b/src/LLVM/AST/CallingConvention.hs
@@ -27,7 +27,7 @@
   | SPIR_KERNEL
   | Intel_OCL_BI
   | X86_64_SysV
-  | X86_64_Win64
+  | Win64
   | Numbered Word32
   deriving (Eq, Read, Show, Typeable, Data, Generic)
 
diff --git a/src/LLVM/AST/FunctionAttribute.hs b/src/LLVM/AST/FunctionAttribute.hs
--- a/src/LLVM/AST/FunctionAttribute.hs
+++ b/src/LLVM/AST/FunctionAttribute.hs
@@ -34,6 +34,7 @@
     | SanitizeAddress
     | SanitizeThread
     | SanitizeMemory
+    | Speculatable
     | StringAttribute {
         stringAttributeKind :: ShortByteString,
         stringAttributeValue :: ShortByteString -- ^ Use "" for no value -- the two are conflated
diff --git a/src/LLVM/AST/Instruction.hs b/src/LLVM/AST/Instruction.hs
--- a/src/LLVM/AST/Instruction.hs
+++ b/src/LLVM/AST/Instruction.hs
@@ -109,7 +109,7 @@
 -- | <http://llvm.org/docs/LangRef.html#singlethread>
 data SynchronizationScope
   = SingleThread
-  | CrossThread
+  | System
   deriving (Eq, Ord, Read, Show, Data, Typeable, Generic)
 
 -- | An 'Atomicity' describes constraints on the visibility of effects of an atomic instruction
diff --git a/src/LLVM/AST/Name.hs b/src/LLVM/AST/Name.hs
--- a/src/LLVM/AST/Name.hs
+++ b/src/LLVM/AST/Name.hs
@@ -3,7 +3,6 @@
 
 import LLVM.Prelude
 import Data.Char
-import Data.Monoid
 import Data.String
 
 {- |
diff --git a/src/LLVM/AST/Type.hs b/src/LLVM/AST/Type.hs
--- a/src/LLVM/AST/Type.hs
+++ b/src/LLVM/AST/Type.hs
@@ -39,6 +39,8 @@
   -- | <http://llvm.org/docs/LangRef.html#metadata-type>
   | MetadataType -- only to be used as a parameter type for a few intrinsics
   -- | <http://llvm.org/docs/LangRef.html#token-type>
+  | LabelType -- only to be used as the type of block names
+  -- | <http://llvm.org/docs/LangRef.html#label-type>
   | TokenType
   deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
 
diff --git a/src/LLVM/DataLayout.hs b/src/LLVM/DataLayout.hs
--- a/src/LLVM/DataLayout.hs
+++ b/src/LLVM/DataLayout.hs
@@ -13,7 +13,6 @@
 import Data.ByteString.Char8 as ByteString hiding (map, foldr)
 import qualified Data.List as List
 import qualified Data.Map as Map
-import Data.Monoid
 import qualified Data.Set as Set
 
 import LLVM.AST.DataLayout
diff --git a/src/LLVM/Prelude.hs b/src/LLVM/Prelude.hs
--- a/src/LLVM/Prelude.hs
+++ b/src/LLVM/Prelude.hs
@@ -14,7 +14,11 @@
     module Control.Monad,
     ByteString,
     ShortByteString,
-    fromMaybe
+    fromMaybe,
+    leftBiasedZip,
+    findM,
+    ifM,
+    (<>)
     ) where
 
 import Prelude hiding (
@@ -30,6 +34,7 @@
 import GHC.Generics (Generic)
 import Data.Int
 import Data.Maybe (fromMaybe)
+import Data.Monoid ((<>))
 import Data.Word
 import Data.Functor
 import Data.Foldable
@@ -44,3 +49,19 @@
 
 import Data.ByteString (ByteString)
 import Data.ByteString.Short (ShortByteString)
+
+leftBiasedZip :: [a] -> [b] -> [(a, Maybe b)]
+leftBiasedZip [] _ = []
+leftBiasedZip xs [] = map (, Nothing) xs
+leftBiasedZip (x:xs) (y:ys) = (x, Just y) : leftBiasedZip xs ys
+
+ifM :: Monad m => m Bool -> m a -> m a -> m a
+ifM cond ifTrue ifFalse = do
+  cond' <- cond
+  if cond'
+    then ifTrue
+    else ifFalse
+
+findM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a)
+findM _ [] = return Nothing
+findM p (x:xs) = ifM (p x) (return $ Just x) (findM p xs)
