[llvm-commits] [llvm] r61934 - in /llvm/trunk: lib/Analysis/ValueTracking.cpp test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll

Chris Lattner clattner at apple.com
Thu Jan 8 21:51:02 PST 2009


On Jan 8, 2009, at 5:53 PM, Dan Gohman wrote:

>
> On Jan 8, 2009, at 4:22 PM, Chris Lattner wrote:
>
>> On Jan 8, 2009, at 4:14 PM, Dan Gohman wrote:
>>>> No, this is just something that Evan noticed.  I don't know that it
>>>> actually manifested as a bug.
>>>
>>>
>>> This is actually a pretty significant language change.  With this
>>> commit, if front-ends want loads and stores from allocas to be done
>>> with preferred alignment, they have to add all the alignment
>>> directives manually. Previously, this just happened automatically.
>>>
>>> I think the previous behavior is more useful. It doesn't make a
>>> lot of sense to pretend that the allocas might not be allocated
>>> according to preferred alignment when they always are.
>>
>> I don't agree. I would call this a deficiency in
>> EnforceKnownAlignment.  EnforceKnownAlignment is the routine
>> responsible for saying "hey I could speed stuff up by making this
>> global be 16-byte aligned" etc.  Why not do it for allocas also?
>
>
> EnforceKnownAlignment already does work on allocas.  But it only
> works when there's a direct load or store to an alloca in the same
> function or to a GlobalVariable defined (not just declared) in the
> same module.  As such, it doesn't apply in all cases.
>
> I suppose we could do something like the attached patch, which
> makes all alloca alignments explicit.

Sure, this seems fine to me!  Please commit,

-Chris



More information about the llvm-commits mailing list