[PATCH] D93317: [LV] Vectorize (some) early and multiple exit loops

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 08:56:44 PST 2020


fhahn requested changes to this revision.
fhahn added a comment.
This revision now requires changes to proceed.

Thank you very much for putting up this patch! This looks like a good start.

I think there are some remaining code-gen issue, e.g. something like the example below leads to a verifier failure, when built with `opt -loop-vectorize -force-vector-width=2`. I didn't have time to take a closer look at what might cause the failure yet.

  define void @test(float* %addr) {
  entry:
    br label %loop.header
  
  loop.header:
    %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
    %gep = getelementptr float, float* %addr, i64 %iv
    %exitcond.not = icmp eq i64 %iv, 200
    br i1 %exitcond.not, label %exit, label %loop.body
  
  loop.body:
    %0 = load float, float* %gep, align 4
    br i1 undef, label %loop.latch, label %then
  
  then:
    store float 10.0, float* %gep, align 4
    br label %loop.latch
  
  loop.latch:
    %iv.next = add nuw nsw i64 %iv, 1
    br label %loop.header
  
  exit:
    ret void
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93317/new/

https://reviews.llvm.org/D93317



More information about the llvm-commits mailing list