[LLVMdev] PR400 - alignment for LD/ST

Christopher Lamb christopher.lamb at gmail.com
Mon Apr 2 08:06:07 PDT 2007


On Apr 1, 2007, at 3:11 AM, Chris Lattner wrote:

> On Sun, 1 Apr 2007, Christopher Lamb wrote:
>> Also I wanted to clear something up about the meaning of the  
>> alignment
>> attribute. My thinking is that this indicates over/under alignment  
>> with
>> respect to natural alignment for the type. This is to say in the  
>> Load/Store
>> instruction classes the default alignment value will be zero,  
>> meaning natural
>> alignment for the given type. If the alignment value is nonzero  
>> then the
>> alignment value should be used over the natural or preferred  
>> alignment.
>
> Yes, exactly.  To put this another way: if the specified alignment  
> is less
> than the natural alignment for the type, then the codegen needs to be
> careful (e.g. use special unaligned loads).  If it is more aligned,  
> then
> this is a guarantee to clients about the load, who can choose to  
> use it or
> not.  If the specified alignment matches the natural alignment,  
> then it
> can be dropped (set to zero).

I have changes in places to implement the bytecode/assembly/ 
instruction changes and propagate them through to SDNode creation in  
the back end. Woot.

When a load or store instruction of alignment 0 (natural) is visited  
in SelectionDAGLowering, should it create an SDNode of alignment 0 or  
should it use the TargetData to set the SDNode's alignment to the  
preferred alignment for the load/store's type for that particular  
target?

--
Christopher Lamb



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070402/5af70097/attachment.html>


More information about the llvm-dev mailing list