[PATCH] D40973: [LV] Remove unnecessary DoExtraAnalysis guard (silent bug)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 14:31:39 PST 2017


fhahn added a comment.

In https://reviews.llvm.org/D40973#948940, @dcaballe wrote:

> Thanks for the quick response, Florian!
>
> I had a test but it didn't convince me. In order to test that a loop without PH is hitting this check we would have to match the ORE message:


Without the early exit, we should fail later in the vectorizer. There is some debug output we could use and check if it does not get emitted when the early exit gets taken?

For example, for the following test function, without your change, the vectorizer bails out because the PHI node contains 3 entries.

  define void @inc(i32 %n, i8* %P) {
    %1 = icmp sgt i32 %n, 0
    br i1 %1, label %BB1, label %BB2
  
  BB1:
    indirectbr i8* %P, [label %.lr.ph]
  
  BB2:
    br label %.lr.ph
  
  .lr.ph:
    %indvars.iv = phi i32 [ %indvars.iv.next, %.lr.ph ], [ 0, %BB1 ], [ 0, %BB2 ]
    %indvars.iv.next = add i32 %indvars.iv, 1
    %exitcond = icmp eq i32 %indvars.iv.next, %n
    br i1 %exitcond, label %._crit_edge, label %.lr.ph
  
  ._crit_edge:  
    ret void
  }




https://reviews.llvm.org/D40973





More information about the llvm-commits mailing list