[llvm-commits] [llvm] r145273 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/ARM/2011-11-28-DAGCombineBug.ll test/CodeGen/X86/widen_load-1.ll

Evan Cheng evan.cheng at apple.com
Mon Nov 28 14:46:38 PST 2011

I've committed r145300 which revert the DAG combine change. It makes InferPtrAlignment() more conservative by returning zero when GV isn't given an alignment nor is it initialized.

Note I am not particularly happy about this fix either. I think the fundamental problem is LLVM ir doesn't have a good way to model "packed" attributes / pragma's.


On Nov 28, 2011, at 1:57 PM, Evan Cheng wrote:

> On Nov 28, 2011, at 1:47 PM, Chris Lattner wrote:
>> On Nov 28, 2011, at 12:54 PM, Duncan Sands wrote:
>>> Hi Evan,
>>>> DAG combine should not increase alignment of loads / stores with alignment less
>>>> than ABI alignment. These are loads / stores from / to "packed" data structures.
>>>> Their alignments are intentionally under-specified.
>>> this doesn't make any sense to me.  Load/store alignment should only be
>>> increased, say from 2 to 4, if it can be proved that the memory being
>>> pointed to is 4 byte aligned.  If InferPtrAlignment is working correctly,
>>> it should only be returning 4 if the memory really is 4 byte aligned.
>>> If you have to sometimes ignore what InferPtrAlignment returns because
>>> (presumably) the memory isn't actually 4 byte aligned, doesn't that just
>>> mean that InferPtrAlignment is buggy and should be fixed?
>> I agree, this doesn't make any sense to me either.  Underaligned loads are exactly the kind that we want to infer improved alignments for!
> The problem is alignment information is only attached to load / store instructions, not on types. If the global variable is not given an alignment, InferPtrAlignment is inferring alignment from the type. After r140902, it's using ABI alignment for GV's which are not specified alignments. Should it return zero instead?
> Evan
>> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

More information about the llvm-commits mailing list