<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 - opt -loop-vectorize crashes with 'VPlan.h:941: [...] "Expected either a single incoming value or a greater than two and even number of operands' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=45525">45525</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt -loop-vectorize crashes with 'VPlan.h:941: [...] "Expected either a single incoming value or a greater than two and even number of operands' failed.
          </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>Linux
          </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>mikael.holmen@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23346" name="attach_23346" title="bbi-41665.ll reproducer">attachment 23346</a> <a href="attachment.cgi?id=23346&action=edit" title="bbi-41665.ll reproducer">[details]</a></span>
bbi-41665.ll reproducer

Reproduce with:
 opt -loop-vectorize -S -o - bbi-41665.ll

Result:
opt: ../lib/Transforms/Vectorize/VPlan.h:941:
llvm::VPBlendRecipe::VPBlendRecipe(llvm::PHINode *, ArrayRef<llvm::VPValue *>):
Assertion `((Operands.size() == 1) || (Operands.size() > 2 && Operands.size() %
2 == 0)) && "Expected either a single incoming value or a greater than two and
" "even number of operands"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: build-all-builtins/bin/opt -loop-vectorize -S -o -
bbi-41665.ll 
1.      Running pass 'Function Pass Manager' on module 'bbi-41665.ll'.
2.      Running pass 'Loop Vectorization' on function '@main'
 #0 0x000000000432de94 PrintStackTraceSignalHandler(void*)
(build-all-builtins/bin/opt+0x432de94)
 #1 0x000000000432ba5e llvm::sys::RunSignalHandlers()
(build-all-builtins/bin/opt+0x432ba5e)
 #2 0x000000000432e1ac SignalHandler(int)
(build-all-builtins/bin/opt+0x432e1ac)
 #3 0x00007fdd82c50890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007fdd816f9e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007fdd816fb801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007fdd816eb39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007fdd816eb412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x00000000044866c1 llvm::VPRecipeBuilder::tryToBlend(llvm::Instruction*,
std::unique_ptr<llvm::VPlan, std::default_delete<llvm::VPlan> >&)
(build-all-builtins/bin/opt+0x44866c1)
 #9 0x00000000044883f5
llvm::VPRecipeBuilder::tryToCreateRecipe(llvm::Instruction*, llvm::VFRange&,
std::unique_ptr<llvm::VPlan, std::default_delete<llvm::VPlan> >&,
llvm::VPBasicBlock*) (build-all-builtins/bin/opt+0x44883f5)
#10 0x00000000044894c7
llvm::LoopVectorizationPlanner::buildVPlanWithVPRecipes(llvm::VFRange&,
llvm::SmallPtrSetImpl<llvm::Value*>&,
llvm::SmallPtrSetImpl<llvm::Instruction*>&, llvm::DenseMap<llvm::Instruction*,
llvm::Instruction*, llvm::DenseMapInfo<llvm::Instruction*>,
llvm::detail::DenseMapPair<llvm::Instruction*, llvm::Instruction*> > const&)
(build-all-builtins/bin/opt+0x44894c7)
#11 0x0000000004483210
llvm::LoopVectorizationPlanner::buildVPlansWithVPRecipes(unsigned int, unsigned
int) (build-all-builtins/bin/opt+0x4483210)
#12 0x0000000004482a24 llvm::LoopVectorizationPlanner::plan(unsigned int)
(build-all-builtins/bin/opt+0x4482a24)
#13 0x000000000448dd3f llvm::LoopVectorizePass::processLoop(llvm::Loop*)
(build-all-builtins/bin/opt+0x448dd3f)
#14 0x0000000004490da4 llvm::LoopVectorizePass::runImpl(llvm::Function&,
llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&,
llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*,
llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&,
std::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&,
llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*)
(build-all-builtins/bin/opt+0x4490da4)
#15 0x0000000004495ab8 (anonymous
namespace)::LoopVectorize::runOnFunction(llvm::Function&)
(build-all-builtins/bin/opt+0x4495ab8)
#16 0x0000000003b8a6d4 llvm::FPPassManager::runOnFunction(llvm::Function&)
(build-all-builtins/bin/opt+0x3b8a6d4)
#17 0x0000000003b8a988 llvm::FPPassManager::runOnModule(llvm::Module&)
(build-all-builtins/bin/opt+0x3b8a988)
#18 0x0000000003b8afdd llvm::legacy::PassManagerImpl::run(llvm::Module&)
(build-all-builtins/bin/opt+0x3b8afdd)
#19 0x00000000023d9ee9 main (build-all-builtins/bin/opt+0x23d9ee9)
#20 0x00007fdd816dcb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#21 0x00000000023c402a _start (build-all-builtins/bin/opt+0x23c402a)
Abort (core dumped)

Starts crashing with commit e2a1867880:

    [LV] Add VPValue operands to VPBlendRecipe (NFCI)

    InnerLoopVectorizer's code called during VPlan execution still relies on
    original IR's def-use relations to decide which vector code to generate,
    limiting VPlan transformations ability to modify def-use relations and
still
    have ILV generate the vector code.
    This commit introduces VPValues for VPBlendRecipe to use as the values to
    blend. The recipe is generated with VPValues wrapping the phi's incoming
values
    of the scalar phi. This reduces ingredient def-use usage by ILV as a step
    towards full VPlan-based def-use relations.

    Differential Revision: <a href="https://reviews.llvm.org/D77539">https://reviews.llvm.org/D77539</a></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>