<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 - [SLPVectorizer] Assertion `idx < size()' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=49730">49730</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SLPVectorizer]  Assertion `idx < size()' failed.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>max.kazantsev@azul.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>To reproduce: run opt -S -passes=slp-vectorizer on the following test:

; ModuleID = './bugpoint-reduced-simplified.bc'
target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
target triple = "x86_64-unknown-linux-gnu"

define void @bar() {
bb:
  %tmp = call i32 @llvm.smin.i32(i32 undef, i32 2)
  %tmp1 = sub nsw i32 undef, %tmp
  %tmp2 = call i32 @llvm.umin.i32(i32 undef, i32 %tmp1)
  %tmp3 = call i32 @llvm.smin.i32(i32 undef, i32 2)
  %tmp4 = sub nsw i32 undef, %tmp3
  %tmp5 = call i32 @llvm.umin.i32(i32 %tmp2, i32 %tmp4)
  %tmp6 = call i32 @llvm.smin.i32(i32 undef, i32 1)
  %tmp7 = sub nuw nsw i32 undef, %tmp6
  %tmp8 = call i32 @llvm.umin.i32(i32 %tmp5, i32 %tmp7)
  %tmp9 = call i32 @llvm.smin.i32(i32 undef, i32 1)
  %tmp10 = sub nsw i32 undef, %tmp9
  %tmp11 = call i32 @llvm.umin.i32(i32 %tmp8, i32 %tmp10)
  %tmp12 = sub nsw i32 undef, undef
  %tmp13 = call i32 @llvm.umin.i32(i32 %tmp11, i32 %tmp12)
  %tmp14 = call i32 @llvm.umin.i32(i32 %tmp13, i32 93)
  ret void
}

; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
declare i32 @llvm.smin.i32(i32, i32)

; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
declare i32 @llvm.umin.i32(i32, i32)



The failure is:
opt:
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallVector.h:281:
const T& llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2>
<span class="quote">>::operator[](llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2>
>::size_type) const [with T = llvm::SmallVector<llvm::Value*, 16>;</span >
<template-parameter-1-2> = void; llvm::SmallVectorTemplateCommon<T,
<template-parameter-1-2> >::const_reference = const
llvm::SmallVector<llvm::Value*, 16>&; llvm::SmallVectorTemplateCommon<T,
<template-parameter-1-2> >::size_type = long unsigned int]: Assertion `idx <
size()' 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: /home/mkazantsev/work/orca_install/RA/bin/opt -S
-passes=slp-vectorizer ./simple.ll
 #0 0x00007f9b9bf6ed4c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Support/Unix/Signals.inc:569:0
 #1 0x00007f9b9bf6cb64 llvm::sys::RunSignalHandlers()
/localhome/mkazantsev/work/orca/orca/llvm/lib/Support/Signals.cpp:71:0
 #2 0x00007f9b9bf6d593 SignalHandler(int)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Support/Unix/Signals.inc:397:0
 #3 0x00007f9b9b494630 __restore_rt sigaction.c:0:0
 #4 0x00007f9b9a83c3d7 raise (/lib64/libc.so.6+0x363d7)
 #5 0x00007f9b9a83dac8 abort (/lib64/libc.so.6+0x37ac8)
 #6 0x00007f9b9a8351a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
 #7 0x00007f9b9a835252 (/lib64/libc.so.6+0x2f252)
 #8 0x00007f9b9d2af584 llvm::isa_impl_cl<llvm::SelectInst, llvm::Value
const*>::doit(llvm::Value const*)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/Support/Casting.h:104:0
 #9 0x00007f9b9d2af584 llvm::isa_impl_wrap<llvm::SelectInst, llvm::Value
const*, llvm::Value const*>::doit(llvm::Value const* const&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/Support/Casting.h:131:0
#10 0x00007f9b9d2af584 llvm::isa_impl_wrap<llvm::SelectInst, llvm::Value*
const, llvm::Value const*>::doit(llvm::Value* const&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/Support/Casting.h:123:0
#11 0x00007f9b9d2af584 bool llvm::isa<llvm::SelectInst,
llvm::Value*>(llvm::Value* const&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/Support/Casting.h:143:0
#12 0x00007f9b9d2af584 llvm::cast_retty<llvm::SelectInst,
llvm::Value*>::ret_type llvm::dyn_cast<llvm::SelectInst,
llvm::Value>(llvm::Value*)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/Support/Casting.h:345:0
#13 0x00007f9b9d2af584 (anonymous
namespace)::HorizontalReduction::createOp(llvm::IRBuilder<llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter>&, llvm::RecurKind, llvm::Value*, llvm::Value*,
llvm::Twine const&, llvm::SmallVector<llvm::SmallVector<llvm::Value*, 16u>, 2u>
const&)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6691:0
#14 0x00007f9b9d2dd85e tryToReduce
/localhome/mkazantsev/work/orca/orca/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7158:0
#15 0x00007f9b9d2dd85e tryToVectorizeHorReductionOrInstOperands(llvm::PHINode*,
llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&,
llvm::TargetTransformInfo*, llvm::function_ref<bool (llvm::Instruction*,
llvm::slpvectorizer::BoUpSLP&)>) (.constprop.1675)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7520:0
#16 0x00007f9b9d2de35d
llvm::SLPVectorizerPass::vectorizeRootInstruction(llvm::PHINode*, llvm::Value*,
llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&, llvm::TargetTransformInfo*)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7575:0
#17 0x00007f9b9d2df29f
llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*,
llvm::slpvectorizer::BoUpSLP&)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7770:0
#18 0x00007f9b9d2dfd4c llvm::SLPVectorizerPass::runImpl(llvm::Function&,
llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*,
llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*,
llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*)
(.part.1670)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6097:0
#19 0x00007f9b9d2e0496 llvm::SLPVectorizerPass::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
/localhome/mkazantsev/work/orca/orca/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6035:0
#20 0x00007f9b9e0251cd llvm::detail::PassModel<llvm::Function,
llvm::SLPVectorizerPass, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManagerInternal.h:86:0
#21 0x00007f9b9c0f9659 llvm::SmallPtrSet<void*,
2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallPtrSet.h:488:0
#22 0x00007f9b9c0f9659
llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManager.h:155:0
#23 0x00007f9b9c0f9659 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManager.h:517:0
#24 0x00007f9b9e020e3d llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
<span class="quote">>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)</span >
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManagerInternal.h:86:0
#25 0x00007f9b9c0f9157 llvm::SmallPtrSet<void*,
2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallPtrSet.h:488:0
#26 0x00007f9b9c0f9157
llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManager.h:155:0
#27 0x00007f9b9c0f9157 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/localhome/mkazantsev/work/orca/orca/llvm/lib/IR/PassManager.cpp:117:0
#28 0x000000000041e5dd llvm::detail::PassModel<llvm::Module,
llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManagerInternal.h:86:0
#29 0x00007f9b9c0f7a47 llvm::SmallPtrSet<void*,
2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallPtrSet.h:488:0
#30 0x00007f9b9c0f7a47
llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManager.h:155:0
#31 0x00007f9b9c0f7a47 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManager.h:517:0
#32 0x0000000000427b92 llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase()
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallPtrSet.h:82:0
#33 0x0000000000427b92
llvm::SmallPtrSetImpl<llvm::AnalysisKey*>::~SmallPtrSetImpl()
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallPtrSet.h:343:0
#34 0x0000000000427b92 llvm::SmallPtrSet<llvm::AnalysisKey*,
2u>::~SmallPtrSet()
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallPtrSet.h:449:0
#35 0x0000000000427b92 llvm::PreservedAnalyses::~PreservedAnalyses()
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/IR/PassManager.h:155:0
#36 0x0000000000427b92 llvm::runPassPipeline(llvm::StringRef, llvm::Module&,
llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*,
llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef,
llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind,
llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool)
/localhome/mkazantsev/work/orca/orca/llvm/tools/opt/NewPMDriver.cpp:453:0
#37 0x000000000041bfa2 llvm::SmallVectorTemplateCommon<llvm::StringRef,
void>::end()
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallVector.h:255:0
#38 0x000000000041bfa2 llvm::SmallVector<llvm::StringRef, 4u>::~SmallVector()
/localhome/mkazantsev/work/orca/orca/llvm/include/llvm/ADT/SmallVector.h:1175:0
#39 0x000000000041bfa2 main
/localhome/mkazantsev/work/orca/orca/llvm/tools/opt/opt.cpp:814:0
#40 0x00007f9b9a828555 __libc_start_main (/lib64/libc.so.6+0x22555)
#41 0x000000000041c85e _start
(/home/mkazantsev/work/orca_install/RA/bin/opt+0x41c85e)
Aborted (core dumped)</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>