<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 failing with Assertion `!BB->getParent()->hasOptSize() && "Cannot SCEV check stride or overflow when optimizing for size"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=43371">43371</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt -loop-vectorize failing with Assertion `!BB->getParent()->hasOptSize() && "Cannot SCEV check stride or overflow when optimizing for size"' 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=22535" name="attach_22535" title="reproducer">attachment 22535</a> <a href="attachment.cgi?id=22535&action=edit" title="reproducer">[details]</a></span>
reproducer

opt -S -o /dev/null lv-optsize-fail-assert-2.ll -loop-vectorize

crashes with

opt: ../lib/Transforms/Vectorize/LoopVectorize.cpp:2699: void
llvm::InnerLoopVectorizer::emitSCEVChecks(llvm::Loop *, llvm::BasicBlock *):
Assertion `!BB->getParent()->hasOptSize() && "Cannot SCEV check stride or
overflow when optimizing for size"' failed.
Stack dump:
0.      Program arguments: build-all/bin/opt -S -o /dev/null
lv-optsize-fail-assert-2.ll -loop-vectorize 
1.      Running pass 'Function Pass Manager' on module
'lv-optsize-fail-assert-2.ll'.
2.      Running pass 'Loop Vectorization' on function '@test_memcpy_imm_1'
 #0 0x00000000024344d4 PrintStackTraceSignalHandler(void*)
(build-all/bin/opt+0x24344d4)
 #1 0x00000000024321fe llvm::sys::RunSignalHandlers()
(build-all/bin/opt+0x24321fe)
 #2 0x00000000024348d8 SignalHandler(int) (build-all/bin/opt+0x24348d8)
 #3 0x00007f5e1249f890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007f5e10f48e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007f5e10f4a801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007f5e10f3a39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007f5e10f3a412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x00000000025508dc llvm::InnerLoopVectorizer::emitSCEVChecks(llvm::Loop*,
llvm::BasicBlock*) (build-all/bin/opt+0x25508dc)
 #9 0x0000000002550dd0
llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton()
(build-all/bin/opt+0x2550dd0)
#10 0x00000000025689f1
llvm::LoopVectorizationPlanner::executePlan(llvm::InnerLoopVectorizer&,
llvm::DominatorTree*) (build-all/bin/opt+0x25689f1)
#11 0x00000000025730e9 llvm::LoopVectorizePass::processLoop(llvm::Loop*)
(build-all/bin/opt+0x25730e9)
#12 0x0000000002574984 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/bin/opt+0x2574984)
#13 0x0000000002578297 (anonymous
namespace)::LoopVectorize::runOnFunction(llvm::Function&)
(build-all/bin/opt+0x2578297)
#14 0x0000000001da3bf3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(build-all/bin/opt+0x1da3bf3)
#15 0x0000000001da3f03 llvm::FPPassManager::runOnModule(llvm::Module&)
(build-all/bin/opt+0x1da3f03)
#16 0x0000000001da456d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(build-all/bin/opt+0x1da456d)
#17 0x00000000007d9b3d main (build-all/bin/opt+0x7d9b3d)
#18 0x00007f5e10f2bb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#19 0x00000000007bec7a _start (build-all/bin/opt+0x7bec7a)
Abort (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>