[LLVMdev] PROPOSAL: IR representation of detailed struct assignment information (new version)

Dan Gohman gohman at apple.com
Mon Sep 10 15:17:01 PDT 2012


On Sep 10, 2012, at 2:54 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> On Mon, 10 Sep 2012 11:29:37 -0700
> Chandler Carruth <chandlerc at google.com> wrote:
> 
>> 
>> Essentially, LLVM is trying to simplify ABI layout by providing a
>> datalayout summary description of target alignments, and building
>> structs with that algorithm. But unless this *exactly* matches the
>> ABI in question, it actually makes the job harder because now we have
>> to try, potentially fail, and end up with all the code to use the
>> packed mode anyways. My theory is that there are too many ABIs in the
>> world (and too weird rules within them) for us to ever really get
>> this right at the LLVM layer.
> 
> This layout logic needs to live somewhere, why can't it live in LLVM?
> Does LLVM not have all of the necessary information for some ABIs? If
> we push all of the necessary information and the associated logic into
> the LLVM layer, then it can be used by multiple frontends.

The LLVM layer does not currently have all of the necessary information.
Bitfields, unions, and inheritance, are some things that are not captured.
You could extend LLVM's type system to represent all these things, and
it might make some things nicer, but how much complexity would it require,
to make LLVM in general aware of this more complex type system?

Dan




More information about the llvm-dev mailing list