[llvm-dev] Possible bug of Alias Analysis?

Song, Ruiling via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 16 23:45:32 PDT 2017


Hi,

I am an out-of-tree user of llvm. I am running into an regression issue against llvm 5.0.
The issue was introduced by "[BasicAA] Use MayAlias instead of PartialAlias for fallback."( https://reviews.llvm.org/D34318)
I have attached a very simple program to reproduce the issue. The symptom is alias analysis report NoAlias to GVN which cause GVN do wrong optimization.
The BasicAA reports MayAlias while TBAA reports NoAlias, when query the pointers of below two instructions in attached sample:
%5 = load float, float addrspace(4)* %add.ptr.i5, align 4, !tbaa !13
store i32 %3, i32* %4, align 4, !tbaa !3
but in fact, they should be aliased as they are writing to/reading from the same buffer.

you can run 'opt -S -aa -basicaa -tbaa -gvn aa-bug.ll -o -' to see what happens.
I am not sure if we use llvm wrong or is it a bug that we should fix in llvm?

Thanks!
Ruiling
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aa-bug.ll
Type: application/octet-stream
Size: 4090 bytes
Desc: aa-bug.ll
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171017/cc4524a1/attachment.obj>


More information about the llvm-dev mailing list