[PATCH] D20789: Consecutive memory access in Loop Vectorizer - fixed and simplified

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 10:34:46 PDT 2016


delena added a comment.

In https://reviews.llvm.org/D20789#503518, @anemet wrote:

> In https://reviews.llvm.org/D20789#503264, @delena wrote:
>
> > This is the output of LoopAccessAnalysis:
> >
> > W:\ver2>build\Debug\bin\opt.exe -O2 test.ll -S -o test_opt.ll  --debug-only=loop-accesses
> >  LAA: Found a loop in _Z23IncrementalCopyFastPathPKcPci: while.body
> >  LAA: Processing memory accesses...
> >
> >   AST: Alias Set Tracker: 1 alias sets for 2 pointer values.
> >   AliasSet[0x24f30a0, 2] may alias, No access Pointers: (i64* %2, 18446744073709551615), (i64* %0, 18446744073709551615)
> >   
> >
> > LAA:   Accesses(2):
> >
> >   %2 = bitcast i8* %op.addr.06 to i64* (write)
> >   %0 = bitcast i8* %src.addr.05 to i64* (read-only)
> >
> > Underlying objects for pointer   %2 = bitcast i8* %op.addr.06 to i64*
> >
> >   i8* %op
> >
> > Underlying objects for pointer   %0 = bitcast i8* %src.addr.05 to i64*
> >
> >   i8* %src
> >
> > LAA: Found a runtime check ptr:  %2 = bitcast i8* %op.addr.06 to i64*
> >  LAA: Found a runtime check ptr:  %0 = bitcast i8* %src.addr.05 to i64*
> >  LAA: We need to do 1 pointer comparisons.
>
>
> LAA says we need a run-time alias check.  Didn't we generate one?
>
> > LAA: We can perform a memory runtime check if needed.
>
> >  LAA: Checking memory dependencies
>
> >  Total Dependences: 0
>


No. It says " Total Dependences: 0" because it checks only pointers with the same leader, like A[i] and A[i+5].
IMO, this is a bug that should be fixed. In a separate patch, of course.

> > LAA: No unsafe dependent memory operations in loop.  We need runtime memory checks.

> 

> >  LAA: Adding RT check for range:

> 

> >  Start: %op End: ((8 * (zext i32 ((8 + (-9 smax (-1 + (-1 * %len))) + %len) /u 8) to i64)) + %op)

> 

> >  LAA: Adding RT check for range:

> 

> >  Start: %src End: ((8 * (zext i32 ((8 + (-9 smax (-1 + (-1 * %len))) + %len) /u 8) to i64)) + %src)

> 

> >  LAA: Found a loop in _Z23IncrementalCopyFastPathPKcPci: while.body

> 

> >  LAA: Processing memory accesses...

> 

> > 

> 

> >   AST: Alias Set Tracker: 1 alias sets for 2 pointer values.

> 

> >   AliasSet[0x24f3eb0, 2] may alias, No access Pointers: (i64* %231, 18446744073709551615), (i64* %229, 18446744073709551615)

> 

> >    

> 

> > 

> 

> > LAA:   Accesses(2):

> 

> > 

> 

> >   %231 = bitcast i8* %op.addr.06 to i64* (write)

> 

> >   %229 = bitcast i8* %src.addr.05 to i64* (read-only)

> 

> > 

> 

> > Underlying objects for pointer   %231 = bitcast i8* %op.addr.06 to i64*

> 

> > 

> 

> >   i8* %op

> 

> > 

> 

> > Underlying objects for pointer   %229 = bitcast i8* %src.addr.05 to i64*

> 

> > 

> 

> >   i8* %src

> 

> > 

> 

> > LAA: Found a runtime check ptr:  %231 = bitcast i8* %op.addr.06 to i64*

> 

> >  LAA: Found a runtime check ptr:  %229 = bitcast i8* %src.addr.05 to i64*

> 

> >  LAA: We need to do 1 pointer comparisons.

> 

> >  LAA: We can perform a memory runtime check if needed.

> 

> >  LAA: Checking memory dependencies

> 

> >  Total Dependences: 0

> 

> >  LAA: No unsafe dependent memory operations in loop.  We need runtime memory checks.

> 

> >  LAA: Found a loop in _Z23IncrementalCopyFastPathPKcPci: vector.body

> 

> >  LAA: SCEV could not compute the loop exit count.

> 





Repository:
  rL LLVM

https://reviews.llvm.org/D20789





More information about the llvm-commits mailing list