<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Assertion `isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!"' failed"
   href="https://llvm.org/bugs/show_bug.cgi?id=30325">30325</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!"' 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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Global Analyses
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>petr.pavlu@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17224" name="attach_17224" title="LLVM IR reproducer">attachment 17224</a> <a href="attachment.cgi?id=17224&action=edit" title="LLVM IR reproducer">[details]</a></span>
LLVM IR reproducer

Compiling file merged.ll with LLVM r280909 produces the following assertion
failure:

$ ./llvm/build/bin/llc merged.ll
llc: /work/merged/llvm/lib/Analysis/ScalarEvolution.cpp:2891: const llvm::SCEV*
llvm::ScalarEvolution::getAddRecExpr(llvm::SmallVectorImpl<const llvm::SCEV*>&,
const llvm::Loop*, llvm::SCEV::NoWrapFlags): Assertion
`isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not
loop-invariant!"' failed.
#0 0x00000000026d22fa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/work/merged/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x00000000026d26b8 PrintStackTraceSignalHandler(void*)
/work/merged/llvm/lib/Support/Unix/Signals.inc:466:0
#2 0x00000000026d09ee llvm::sys::RunSignalHandlers()
/work/merged/llvm/lib/Support/Signals.cpp:44:0
#3 0x00000000026d1c6b SignalHandler(int)
/work/merged/llvm/lib/Support/Unix/Signals.inc:256:0
#4 0x00007fd6765c1c30 __restore_rt (/lib64/libpthread.so.0+0x10c30)
#5 0x00007fd6755706f5 __GI_raise
/usr/src/debug/glibc-2.23-81-g2eda04e/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#6 0x00007fd6755722fa __GI_abort
/usr/src/debug/glibc-2.23-81-g2eda04e/stdlib/abort.c:91:0
#7 0x00007fd675568f97 __assert_fail_base
/usr/src/debug/glibc-2.23-81-g2eda04e/assert/assert.c:92:0
#8 0x00007fd675569042 (/lib64/libc.so.6+0x2d042)
#9 0x0000000001c108f9
llvm::ScalarEvolution::getAddRecExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&,
llvm::Loop const*, llvm::SCEV::NoWrapFlags)
/work/merged/llvm/lib/Analysis/ScalarEvolution.cpp:2890:0
#10 0x0000000001c103d2 llvm::ScalarEvolution::getAddRecExpr(llvm::SCEV const*,
llvm::SCEV const*, llvm::Loop const*, llvm::SCEV::NoWrapFlags)
/work/merged/llvm/lib/Analysis/ScalarEvolution.cpp:2875:0
#11 0x0000000002395f66 CollectSubexprs(llvm::SCEV const*, llvm::SCEVConstant
const*, llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::Loop const*,
llvm::ScalarEvolution&, unsigned int)
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3212:0
#12 0x0000000002395e18 CollectSubexprs(llvm::SCEV const*, llvm::SCEVConstant
const*, llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::Loop const*,
llvm::ScalarEvolution&, unsigned int)
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3198:0
#13 0x0000000002396273 (anonymous
namespace)::LSRInstance::GenerateReassociationsImpl((anonymous
namespace)::LSRUse&, unsigned int, (anonymous namespace)::Formula const&,
unsigned int, unsigned long, bool)
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3238:0
#14 0x0000000002396a93 (anonymous
namespace)::LSRInstance::GenerateReassociations((anonymous namespace)::LSRUse&,
unsigned int, (anonymous namespace)::Formula, unsigned int)
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3323:0
#15 0x000000000239a2b7 (anonymous
namespace)::LSRInstance::GenerateAllReuseFormulae()
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3829:0
#16 0x00000000023a0841 (anonymous
namespace)::LSRInstance::LSRInstance(llvm::Loop*, llvm::IVUsers&,
llvm::ScalarEvolution&, llvm::DominatorTree&, llvm::LoopInfo&,
llvm::TargetTransformInfo const&)
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:4854:0
#17 0x00000000023a1216 ReduceLoopStrength(llvm::Loop*, llvm::IVUsers&,
llvm::ScalarEvolution&, llvm::DominatorTree&, llvm::LoopInfo&,
llvm::TargetTransformInfo const&)
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:4993:0
#18 0x00000000023a1472 (anonymous
namespace)::LoopStrengthReduce::runOnLoop(llvm::Loop*, llvm::LPPassManager&)
/work/merged/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5025:0
#19 0x00000000029414a0 llvm::LPPassManager::runOnFunction(llvm::Function&)
/work/merged/llvm/lib/Analysis/LoopPass.cpp:198:0
#20 0x000000000220b1c3 llvm::FPPassManager::runOnFunction(llvm::Function&)
/work/merged/llvm/lib/IR/LegacyPassManager.cpp:1522:0
#21 0x000000000220b33a llvm::FPPassManager::runOnModule(llvm::Module&)
/work/merged/llvm/lib/IR/LegacyPassManager.cpp:1543:0
#22 0x000000000220b687 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/work/merged/llvm/lib/IR/LegacyPassManager.cpp:1599:0
#23 0x000000000220bd3b llvm::legacy::PassManagerImpl::run(llvm::Module&)
/work/merged/llvm/lib/IR/LegacyPassManager.cpp:1702:0
#24 0x000000000220bf33 llvm::legacy::PassManager::run(llvm::Module&)
/work/merged/llvm/lib/IR/LegacyPassManager.cpp:1734:0
#25 0x0000000000d6e38f compileModule(char**, llvm::LLVMContext&)
/work/merged/llvm/tools/llc/llc.cpp:509:0
#26 0x0000000000d6cc70 main /work/merged/llvm/tools/llc/llc.cpp:274:0
#27 0x00007fd67555c731 __libc_start_main
/usr/src/debug/glibc-2.23-81-g2eda04e/csu/../csu/libc-start.c:323:0
#28 0x0000000000d6b0a9 _start (./llvm/build/bin/llc+0xd6b0a9)
Stack dump:
0.      Program arguments: ./llvm/build/bin/llc merged.ll
1.      Running pass 'Function Pass Manager' on module 'merged.ll'.
2.      Running pass 'Loop Pass Manager' on function '@f'
3.      Running pass 'Loop Strength Reduction' on basic block '%vector.body'
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>