[llvm-commits] [llvm] r43270 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/PowerPC/2007-10-23-UnalignedMemcpy.ll

Bill Wendling isanbard at gmail.com
Wed Oct 24 17:12:45 PDT 2007


The alloca doesn't have an alignment requirement:

@C.0.1173 = external constant [33 x i8]

define void @Bork() {
entry:
        %Qux = alloca [33 x i8]
        %Qux1 = bitcast [33 x i8]* %Qux to i8*
	call void @llvm.memcpy.i64( i8* %Qux1, i8* getelementptr ([33 x i8]*
@C.0.1173, i32 0, i32 0), i64 33, i32 8 )
        ret void
}

declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)

I tried adding an alignment to the Store & Load SDNodes that were
created. Passing in the "Align" variable (which is set to 8) doesn't
work. If I pass in "1", it works (but isn't good).

-bw

On 10/24/07, Evan Cheng <evan.cheng at apple.com> wrote:
>
> Ok, then the problem is just this stack object is misaligned? I
> thought the source specified this alloca should be 4-byte aligned?
>
> Evan
>
> >
> > entry: 0x1203860, LLVM BB @0x1201480, ID#0:
> >          %r2 = LIS8 <ga:C.0.1173>
> >          %r2 = LD <ga:C.0.1173>, %r2<kill>
> >          %r3 = LBZ 32, %r2
> >          %r4 = LD 0, %r2
> >          STB %r3<kill>, 32, <fi#0>
> >          %r3 = LD 2, %r2
> >          %r5 = LD 4, %r2
> >          %r2 = LD 6, %r2<kill>
> >          STD %r4<kill>, 0, <fi#0>
> >          STD %r3<kill>, 2, <fi#0>
> >          STD %r5<kill>, 4, <fi#0>
> >          STD %r2<kill>, 6, <fi#0>
> >          BLR 20, %cr0<kill>
> >
> > # End machine code for Bork().
> >
> > The second time through (while processing the "STD %r4<kill>, 0,
> > <fi#0>"), the "STB" is now "STB %r3<kill>, -1, %r1" and the Offset is
> > -33.
> >
> > -bw
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> 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