[llvm-dev] Aliasing Issue after vectorization (original) (raw)
Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Fri Sep 8 16:23:05 PDT 2017
- Previous message: [llvm-dev] Aliasing Issue after vectorization
- Next message: [llvm-dev] Change commit list associated with debuginfo-tests?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, Charith,
I don't think that we can figure this out from only what you've presented. Could you file a bug report with the full IR for the different cases at bugs.llvm.org? We'd need to at least see how the %"class.internal::BlockVectorIterators::Iterator" type is defined and how the TBAA metadata is defined in both cases, but we might need to look at what the AA implementation is doing in more detail.
-Hal
On 09/08/2017 12:16 PM, Charith Mendis via llvm-dev wrote:
Hi all,
I used LLVM's SLP vectorization pass and set the vector register width to 64. LLVM vectorizes A,B into E. The question is regarding aliasing, where before vectorization LLVM returns that both A and B do not alias with C individually. But after vectorization LLVM returns that E which is the vectorized value of A and B does alias with D (same as C). Can this happen and why is LLVM's alias analysis returning they are infact aliased? Thank You! Before vectorization entry: %0 = bitcast %"class.internal::BlockVectorIterators::Iterator"* %c to i64* %1 = load i64, i64* %0, align 8, !tbaa !2 %2 = bitcast %"class.internal::BlockVectorIterators::Iterator"* %this to i64* store i64 %1, i64* %2, align 8, !tbaa !2 %globalindex = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 1 A:%3 = load i32, i32* %globalindex, align 8, !tbaa !8 %globalindex3 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 1 store i32 %3, i32* %globalindex3, align 8, !tbaa !8 %indexwithinblock = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 3 %4 = load i32, i32* %indexwithinblock, align 8, !tbaa !9 %indexwithinblock4 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 3 C: store i32 %4, i32* %indexwithinblock4, align 8, !tbaa !9 %currentblock = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 2 B: %5 = load i32, i32* %currentblock, align 4, !tbaa !10 %currentblock5 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 2 store i32 %5, i32* %currentblock5, align 4, !tbaa !10 %nextbreakforward = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 4 %6 = load i32, i32* %nextbreakforward, align 4, !tbaa !11 %nextbreakforward6 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 4 store i32 %6, i32* %nextbreakforward6, align 4, !tbaa !11 %nextbreakbackward = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 5 %7 = load i32, i32* %nextbreakbackward, align 8, !tbaa !12 %nextbreakbackward7 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 5 store i32 %7, i32* %nextbreakbackward7, align 8, !tbaa !12 ret %"class.internal::BlockVectorIterators::Iterator"* %this
After vectorization entry: %0 = bitcast %"class.internal::BlockVectorIterators::Iterator"* %c to i64* %1 = load i64, i64* %0, align 8, !tbaa !2 %2 = bitcast %"class.internal::BlockVectorIterators::Iterator"* %this to i64* store i64 %1, i64* %2, align 8, !tbaa !2 %globalindex = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 1 %globalindex3 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 1 %indexwithinblock = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 3 %3 = load i32, i32* %indexwithinblock, align 8, !tbaa !8 %indexwithinblock4 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 3 D: store i32 %3, i32* %indexwithinblock4, align 8, !tbaa !8 %currentblock = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 2 %4 = bitcast i32* %globalindex to <2 x i32>* E: %5 = load <2 x i32>, <2 x i32>* %4, align 8, !tbaa !9 %currentblock5 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 2 %6 = bitcast i32* %globalindex3 to <2 x i32>* store <2 x i32> %5, <2 x i32>* %6, align 8, !tbaa !9 %nextbreakforward = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 4 %7 = load i32, i32* %nextbreakforward, align 4, !tbaa !10 %nextbreakforward6 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 4 store i32 %7, i32* %nextbreakforward6, align 4, !tbaa !10 %nextbreakbackward = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %c, i64 0, i32 5 %8 = load i32, i32* %nextbreakbackward, align 8, !tbaa !11 %nextbreakbackward7 = getelementptr inbounds %"class.internal::BlockVectorIterators::Iterator", %"class.internal::BlockVectorIterators::Iterator"* %this, i64 0, i32 5 store i32 %8, i32* %nextbreakbackward7, align 8, !tbaa !11 ret %"class.internal::BlockVectorIterators::Iterator"* %this -- Kind regards, Charith Mendis Graduate Student, CSAIL, Massachusetts Institute of Technology
LLVM Developers mailing list llvm-dev at lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-- Hal Finkel Lead, Compiler Technology and Programming Languages Leadership Computing Facility Argonne National Laboratory
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170908/0eca3127/attachment.html>
- Previous message: [llvm-dev] Aliasing Issue after vectorization
- Next message: [llvm-dev] Change commit list associated with debuginfo-tests?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]