[GHC] #9142: LLVM HEAD rejects aliases used by LLVM codegen
GHC
ghc-devs at haskell.org
Sat Jul 19 15:50:30 UTC 2014
#9142: LLVM HEAD rejects aliases used by LLVM codegen
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.10.1
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Differential Revisions: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple | Test Case:
Difficulty: Unknown | Blocking: 4213
Blocked By: |
Related Tickets: |
-------------------------------------+-------------------------------------
Comment (by bgamari):
This morning I approached this issue with a fresh perspective and realized
that the solutions is quite simple (unless I've missed something). The
issue with new LLVMs is that aliases can't point to things that aren't
definitions.
As it turns out, the only case where we emit aliases pointing to non-
definitions is for external symbols where we emit an extern declaration
and a corresponding alias. Unless I'm mistaken, there is no reason why
both of these are necessary: we only use the alias. So, instead of
emitting,
{{{
@stg_BCO_info = external global i8
@stg_BCO_info$alias = alias private i8* @stg_BCO_info
}}}
we should be emitting,
{{{
@stg_BCO_info$alias = external global i8
}}}
I've implemented this change in my [llvm-3.5-new branch
https://github.com/bgamari/ghc/compare/llvm-3.5-new and it appears to work
(or rather, the GHC build hasn't failed yet; I also have yet to verify
that LLVM 3.4 still works).
Of course, there are still nice opportunities for cleaning up TNTC (as
discussed in #4213), but at least this fixes the immediate problem.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9142#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list