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

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 10:54:00 PDT 2016


mkuper added a comment.

I tried building with r274114 (before this was reverted), and we did generate a runtime alias check:

  vector.memcheck:                                  ; preds = %min.iters.checked
    %7 = sub i32 -1, %len
    %8 = icmp sgt i32 %7, -9
    %smax9 = select i1 %8, i32 %7, i32 -9
    %9 = add i32 %len, %smax9
    %10 = add i32 %9, 8
    %11 = lshr i32 %10, 3
    %12 = zext i32 %11 to i64
    %13 = shl i64 %12, 3
    %scevgep = getelementptr i8, i8* %op, i64 %13
    %scevgep10 = getelementptr i8, i8* %src, i64 %13
    %bound0 = icmp ule i8* %op, %scevgep10
    %bound1 = icmp ule i8* %src, %scevgep
    %found.conflict = and i1 %bound0, %bound1
    %memcheck.conflict = and i1 %found.conflict, true
    %cast.crd = trunc i64 %n.vec to i32
    %14 = shl i32 %cast.crd, 3
    %ind.end = sub i32 %len, %14
    %15 = shl i64 %n.vec, 3
    %ind.end12 = getelementptr i8, i8* %op, i64 %15
    %ind.end14 = getelementptr i8, i8* %src, i64 %15
    br i1 %memcheck.conflict, label %scalar.ph, label %vector.ph

I'm not sure this runtime check is correct, though.


Repository:
  rL LLVM

https://reviews.llvm.org/D20789





More information about the llvm-commits mailing list