[cfe-dev] Alignment of bitfield structs

Ahmed Bougacha ahmed.bougacha at gmail.com
Mon Apr 20 13:19:57 PDT 2015


On Mon, Apr 20, 2015 at 1:10 PM, Reid Kleckner <rnk at google.com> wrote:
> On Mon, Apr 20, 2015 at 6:57 AM, Bradley Smith <bradley.smith at arm.com>
> wrote:
>>
>> However, when this IR goes down to LLVM there is no context of the
>> bitfields
>> left so LLVM just sees an i64 load from an i40. InstCombine sees this and
>> blindly (but correctly I believe, based on the information it has)
>> converts
>> this load to the ABI alignment of i64, which is now incorrect.
>
>
> This seems suspicious to me. I always thought that 'load i32..., align 1'
> was a supported way to ask the backend to do the load slicing if needed, and
> this instcombine breaks that.

Right, but it does that because it can see that @g will be
ABI-aligned, no?  If I do "@g ..., align 4" the load alignment doesn't
change, as expected.

-Ahmed

> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list