[llvm-commits] [llvm] r43120 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/PowerPC/2007-10-18-PtrArithmetic.ll

Bill Wendling isanbard at gmail.com
Thu Oct 18 10:58:07 PDT 2007


On 10/18/07, Chris Lattner <clattner at apple.com> wrote:
>
> On Oct 18, 2007, at 1:32 AM, Bill Wendling wrote:
>
> > Author: void
> > Date: Thu Oct 18 03:32:37 2007
> > New Revision: 43120
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=43120&view=rev
> > Log:
> > Pointer arithmetic should be done with the index the same size as
> > the pointer.
>
> Nice catch Bill.  Should this use sign extend or zero extend if the
> value is too small?  It seems like zext would be more appropriate,
>
There was a similar case before with CFA_OFFSET that I tackled before.
I went back and forth with Anton a few times and he came up with
essentially the patch you saw there:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-August/010424.html

I was thinking about sign-extend vs. zero-extend afterwards and I
think the reason behind the sign-extend is to allow for negative
indexes. Does that sound reasonable?

-bw



More information about the llvm-commits mailing list