<div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 10, 2012 at 3:17 PM, Dan Gohman <span dir="ltr"><<a href="mailto:gohman@apple.com" target="_blank" class="cremed">gohman@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On Sep 10, 2012, at 2:54 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" class="cremed">hfinkel@anl.gov</a>> wrote:<br>
<br>
> On Mon, 10 Sep 2012 11:29:37 -0700<br>
> Chandler Carruth <<a href="mailto:chandlerc@google.com" class="cremed">chandlerc@google.com</a>> wrote:<br>
><br>
>><br>
</div><div class="im">>> Essentially, LLVM is trying to simplify ABI layout by providing a<br>
>> datalayout summary description of target alignments, and building<br>
>> structs with that algorithm. But unless this *exactly* matches the<br>
>> ABI in question, it actually makes the job harder because now we have<br>
>> to try, potentially fail, and end up with all the code to use the<br>
>> packed mode anyways. My theory is that there are too many ABIs in the<br>
>> world (and too weird rules within them) for us to ever really get<br>
>> this right at the LLVM layer.<br>
><br>
> This layout logic needs to live somewhere, why can't it live in LLVM?<br>
> Does LLVM not have all of the necessary information for some ABIs? If<br>
> we push all of the necessary information and the associated logic into<br>
> the LLVM layer, then it can be used by multiple frontends.<br>
<br>
</div>The LLVM layer does not currently have all of the necessary information.<br>
Bitfields, unions, and inheritance, are some things that are not captured.<br>
You could extend LLVM's type system to represent all these things, and<br>
it might make some things nicer, but how much complexity would it require,<br>
to make LLVM in general aware of this more complex type system?</blockquote><div><br></div><div>Indeed, I think that we should move the opposite direction. I think LLVM should be exposing a more low-level concept of layout than what it does.</div>
</div></div>