[llvm-bugs] [Bug 30325] New: Assertion `isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 8 03:02:31 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30325

            Bug ID: 30325
           Summary: Assertion `isLoopInvariant(Operands[i], L) &&
                    "SCEVAddRecExpr operand is not loop-invariant!"'
                    failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: petr.pavlu at arm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17224
  --> https://llvm.org/bugs/attachment.cgi?id=17224&action=edit
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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160908/a1bf519e/attachment-0001.html>


More information about the llvm-bugs mailing list