[LLVMdev] GHC, aliases, and LLVM HEAD

Reid Kleckner rnk at google.com
Tue May 27 12:59:58 PDT 2014


On Mon, May 26, 2014 at 9:18 PM, Chandler Carruth <chandlerc at google.com>wrote:

>
> On Mon, May 26, 2014 at 5:05 PM, Ben Gamari <bgamari.foss at gmail.com>wrote:
>
>> Our C-- representation might refer to `f` without calling it (e.g. when
>> building a thunk). In this case we don't have access to the function's
>> signature, which we can only infer from a `call` node. For this reason,
>> we currently demote all pointers to some common type (i8* currently) so
>> we don't run into LLVM's type system in cases where we can't infer a
>> value's type.
>>
>
> Couldn't you then conjure up an i8* global (or whatever other placeholder
> you want) and when you discover that it is in fact a function, replace all
> the uses with a bitcast from the actual function to an i8*?
>

I believe GHC streams textual LLVM assembly to a file and invokes llc
separately.

I could imagine a system that streams out a function definition at a time,
where each definition is preceded by declarations of all symbols that it
needs, with types inferred from the call nodes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140527/250d10c3/attachment.html>


More information about the llvm-dev mailing list