[LLVMdev] Address calculation

Chris Lattner clattner at apple.com
Mon Oct 6 21:09:24 PDT 2008

On Oct 6, 2008, at 5:20 PM, Villmow, Micah wrote:

> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Eli Friedman
> Sent: Monday, October 06, 2008 4:41 PM
> To: LLVM Developers Mailing List
> Subject: Re: [LLVMdev] Address calculation
> On Mon, Oct 6, 2008 at 9:03 AM, Villmow, Micah <Micah.Villmow at amd.com>
> wrote:
>> I am attempting to get indexing code generation working with my
> backend.
>> However, it seems that the addresses being calculated is being
> multiplied by
>> the width of the data type.
> That's how most normal architectures/address spaces work.  Is there
> something unusual about address space 11 in your architecture?
> With the backend that I'm targeting, various address spaces have
> different alignment constraints. In this specific case, the number  
> being
> passed in as the offset to the pointer needs to be interpreted as the
> nth element, not the nth byte. There is an underlying hw specific
> compiler that does the exact address calculations, so I don't want  
> to make these addressing assumptions.

You need to fix your compiler then, it is generating the wrong LLVM  
IR.  Generating the wrong IR is not just going to cause you codegen  
issues, this will severely break the optimizer and just about  
everything else in LLVM.  This path is a non-starter,


More information about the llvm-dev mailing list