• Erik de Castro Lopo's avatar
    LLVM: Tweak TBAA metadata codegen · 9d67f04d
    Erik de Castro Lopo authored
    This change is requred for llvm 4.0. GHC doesn't use that version yet,
    but this change is just as valid for versions eariler than 4.0.
    
    Two changes needed:
    
    * Previously, GHC defined a `topN` node in the TBAA heiarchy and some IR
      instructions referenced that node. With LLVM 4.0 the root node can no
      longer be referenced by IR instructions, so we introduce a new element
      `rootN` and make `topN` a child of that.
    
    * Previously the root TBAA node was rendered as "!0 = !{!"root", null}".
      With LLVM 4.0 that needs to be "!0 = !{!"root"}" which is also
      accepted by earlier versions.
    
    Test Plan: Build with quick-llvm BuildFlavor and run tests
    
    Reviewers: bgamari, drbo, austin, angerman, michalt, DemiMarie
    
    Reviewed By: DemiMarie
    
    Subscribers: mpickering, DemiMarie, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2975
    9d67f04d
LlvmCodeGen.hs 7.26 KB