[llvm-dev] Is the correct behavior of getelementptr i192* for opt + llc -march=aarch64?
Mehdi Amini via llvm-dev
llvm-dev at lists.llvm.org
Tue Nov 8 21:04:23 PST 2016
Can you provide the full repro?
Also what is the IR output of opt -O3?
—
Mehdi
> On Nov 8, 2016, at 7:31 PM, MITSUNARI Shigeo via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Hi all,
> opt and opt + llc generate the difference aarch64 asm code for the following LLVM code.
>
> Is it intended behavior?
> I expected (A) because I cast %p from i192* to i64*.
> The information is dropped by opt and 8-byte padding is inserted or I write a bad code?
>
> % cat a.ll
> define void @store0_to_p4(i192* %p)
> {
> %p1 = bitcast i192* %p to i64*
> %p2 = getelementptr i64, i64* %p1, i64 3
> %p3 = getelementptr i64, i64* %p2, i64 1
> store i64 0, i64* %p3
> ret void
> }
>
> % llc-3.8 a.ll -O3 -o - -march=aarch64
> store0_to_p4:
> str xzr, [x0, #32] ; (A)
> ret
>
> % opt-3.8 -O3 a.ll -o - | llc-3.8 -O3 -o - -march=aarch64
> store0_to_p4:
> str xzr, [x0, #40] ; (B)
> ret
>
> Yours,
> Shigeo
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
More information about the llvm-dev
mailing list