[cfe-dev] Passing StructType arguments directly

Matthieu Monrocq matthieu.monrocq at gmail.com
Tue Sep 20 10:57:51 PDT 2011


2011/9/20 Reid Kleckner <reid.kleckner at gmail.com>

> On Sun, Sep 18, 2011 at 10:48 PM, David Meyer <pdox at google.com> wrote:
> > One idea would be to have a bitcode -> bitcode pass which is
> > responsible for lowering the higher-level representations (structs,
> > unions, complex) down to simple types, in a target-specific way. This
> > includes coercing parameters, expanding va_arg, and so on. This would
> > move the target-specific lowering into LLVM and out of the front-ends.
> > (This pass would be idempotent)
>
> This idea of a ABI-neutral IR layer has come up before (can't find the
> link), which probably means that it's worth considering.  I don't know
> if it means it's a good idea or if it's just a bad idea that looks
> good.  :)
>
> In any case, the ability to generate target-neutral bitcode seems to
> me like the most commonly requested enhancement.  I think the LLVM
> project should either reject it outright as a non-goal or decide on
> the future direction for how to achieve it.  OTOH this is an open
> source project with many stakeholders with different priorities, so
> it's hard to make that kind of decision.
>
> ...
>
> If you do want to add the target-neutral IR layer, it's probably best
> to completely avoid optimizing such bitcode, because it's likely to
> create bugs in the optimizers that don't expect FCAs, unions,
> bitfields, pointer-sized integers, etc to be there.
>
> Reid
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>

Since we are talking about target independent representation I feel
compelled to post a link to one of the presentation of the last LLVM
Developer meeting (Sept 16th):
http://llvm.org/devmtg/2011-09-16/EuroLLVM2011-MoreTargetIndependentLLVMBitcode.pdf

The author explains at lengths the various ways in which LLVM is target
dependent and speaks about WordCode, a target independent IR that can be
lowered in a subsequent pass.

I don't know whether it's immediately usable for PNaCl, but I hope it might
help the discussion.

-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110920/0f132feb/attachment.html>


More information about the cfe-dev mailing list