[GHC] #4213: LLVM: Add support for TNTC to LLVM compiler suite
GHC
cvs-ghc at haskell.org
Wed Jan 25 23:38:38 CET 2012
#4213: LLVM: Add support for TNTC to LLVM compiler suite
---------------------------------+------------------------------------------
Reporter: dterei | Owner: dterei
Type: feature request | Status: new
Priority: normal | Milestone: 7.4.1
Component: Compiler (LLVM) | Version: 6.13
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by dterei):
No clear way forward. I have two ideas on how to approach it
1. Add a new special llvm variable 'llvm.order' similar to how LLVM has
the [http://llvm.org/docs/LangRef.html#intg_used 'llvm.used'] variable.
This variable would be a array type, containing function and global
pointers where their order in the array is the order they should be
printed to assembly in. This should be enough to get us TNTC but it's
perhaps a little of a hacky way to achieve it. The upside is it should be
pretty easy to implement and get accepted upstream. It basically
corresponds to the GCC option 'fno-toplevel-reorder'.
2. Add support for attaching a global variable to a function. So this
would be a fairly direct TNTC mapping to LLVM IR. Upside is the direct
conveying of TNTC semantics may make it safer (maintained in the face of
change) and pen up opportunities for optimisation. Downside is I think
this would be a fair amount of work and may be too specific to GHC for
getting accepted by LLVM.
If I ever get the time to hack on this I would give 1 a go first. I think
it could potentially be done in a day or two by someone who knew LLVM
already.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4213#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list