<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Loop Vectorizer triggers an assert "IsOrdered requires IsInLoop""
   href="https://bugs.llvm.org/show_bug.cgi?id=52515">52515</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Loop Vectorizer triggers an assert "IsOrdered requires IsInLoop"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Loop Optimizer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>serguei.katkov@azul.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For the following reduced test case
===============================================
; ModuleID = 'bad.ll'
source_filename = "bad.ll"
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-none-linux-gnu"

define float @wombat() {
bb:
  br label %bb1

bb1:                                              ; preds = %bb9, %bb
  %tmp = phi i64 [ 0, %bb ], [ %tmp10, %bb9 ]
  %tmp2 = phi float [ 0.000000e+00, %bb ], [ %tmp4, %bb9 ]
  %tmp3 = phi i64 [ 0, %bb ], [ %tmp5, %bb9 ]
  %tmp4 = fadd float %tmp2, 1.000000e+00
  %tmp5 = add nsw i64 %tmp3, 1
  %tmp6 = icmp ult i64 %tmp, 65536
  br i1 %tmp6, label %bb9, label %bb7

bb7:                                              ; preds = %bb1
  %tmp8 = phi float [ %tmp4, %bb1 ]
  ret float %tmp8

bb9:                                              ; preds = %bb1
  %tmp10 = add nuw nsw i64 %tmp, 1
  br i1 false, label %bb11, label %bb1

bb11:                                             ; preds = %bb9
  %tmp12 = phi float [ %tmp4, %bb9 ]
  ret float %tmp12
}

!0 = !{!"function_entry_count", i64 32768}
===============================================
the following assert is triggered.

===============================================
<span class="quote">> opt  -passes=loop-vectorize -S bad.ll</span >
opt:
/localhome/skatkov/work/llvm/src/llvm/lib/Transforms/Vectorize/VPlan.h:1186:
llvm::VPReductionPHIRecipe::VPReductionPHIRecipe(llvm::PHINode*,
llvm::RecurrenceDescriptor&, llvm::VPValue&, bool, bool): Assertion
`(!IsOrdered || IsInLoop) && "IsOrdered requires IsInLoop"' failed.
===============================================
The current processing phi node is

%tmp2 = phi float [ 0.000000e+00, %bb ], [ %tmp4, %bb9 ]</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>