[llvm-bugs] [Bug 43436] New: indvars crashes: Assertion `isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!"' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Sep 24 19:34:24 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=43436
Bug ID: 43436
Summary: indvars crashes: Assertion
`isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr
operand is not loop-invariant!"' failed.
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: cszide at 163.com
CC: llvm-bugs at lists.llvm.org
Created attachment 22565
--> https://bugs.llvm.org/attachment.cgi?id=22565&action=edit
bugpoint-reduced-simplified.bc
This bug is triggered by a real program 'cholesky' from splash-3 benchmark.
$clang -v
clang version 10.0.0 (trunk 372743)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$opt bugpoint-reduced-simplified.bc -indvars -loop-unswitch -indvars
opt:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/lib/Analysis/ScalarEvolution.cpp:3417:
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.
Stack dump:
0. Program arguments:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt
bugpoint-reduced-simplified.bc -indvars -loop-unswitch -indvars
1. Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.bc'.
2. Running pass 'Loop Pass Manager' on function '@PerformUpdate'
3. Running pass 'Induction Variable Simplification' on basic block
'%for.body18.i74.lver.orig'
#0 0x0000556f7463632a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x278232a)
#1 0x0000556f74634004 llvm::sys::RunSignalHandlers()
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2780004)
#2 0x0000556f74634142 SignalHandler(int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2780142)
#3 0x00007f7dc1351890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x00007f7dc0003e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f7dc0005801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
#6 0x00007f7dbfff539a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
#7 0x00007f7dbfff5412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#8 0x0000556f739c062d
llvm::ScalarEvolution::getAddRecExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&,
llvm::Loop const*, llvm::SCEV::NoWrapFlags)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b0c62d)
#9 0x0000556f739c4ef5
llvm::ScalarEvolution::getMulExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&,
llvm::SCEV::NoWrapFlags, unsigned int) (.part.1505)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b10ef5)
#10 0x0000556f7385ca04 llvm::ScalarEvolution::getMulExpr(llvm::SCEV const*,
llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x19a8a04)
#11 0x0000556f739ca9c3 llvm::ScalarEvolution::getMinusSCEV(llvm::SCEV const*,
llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b169c3)
#12 0x0000556f739bbc07 llvm::ScalarEvolution::getNotSCEV(llvm::SCEV const*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b07c07)
#13 0x0000556f739d3aff
llvm::ScalarEvolution::isImpliedCondOperands(llvm::CmpInst::Predicate,
llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b1faff)
#14 0x0000556f739b30e9
llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*, llvm::CmpInst::Predicate, llvm::SCEV const*,
llvm::SCEV const*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1aff0e9)
#15 0x0000556f739d2104
llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*, llvm::Value*, bool)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b1e104)
#16 0x0000556f739d2189
llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*, llvm::Value*, bool)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b1e189)
#17 0x0000556f739d2343
llvm::ScalarEvolution::isLoopEntryGuardedByCond(llvm::Loop const*,
llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV
const*)::'lambda0'(llvm::Value*, bool)::operator()(llvm::Value*, bool) const
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b1e343)
#18 0x0000556f739d34de
llvm::ScalarEvolution::isLoopEntryGuardedByCond(llvm::Loop const*,
llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b1f4de)
#19 0x0000556f739ba55c
llvm::ScalarEvolution::isKnownViaInduction(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b0655c)
#20 0x0000556f739ba5c3
llvm::ScalarEvolution::isKnownPredicate(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b065c3)
#21 0x0000556f74747d2c (anonymous
namespace)::SimplifyIndvar::simplifyUsers(llvm::PHINode*, llvm::IVVisitor*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2893d2c)
#22 0x0000556f747494ae llvm::simplifyUsersOfIV(llvm::PHINode*,
llvm::ScalarEvolution*, llvm::DominatorTree*, llvm::LoopInfo*,
llvm::SmallVectorImpl<llvm::WeakTrackingVH>&, llvm::SCEVExpander&,
llvm::IVVisitor*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x28954ae)
#23 0x0000556f743d2b60 (anonymous
namespace)::IndVarSimplify::simplifyAndExtend(llvm::Loop*, llvm::SCEVExpander&,
llvm::LoopInfo*) (.constprop.490)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x251eb60)
#24 0x0000556f743d53d7 (anonymous namespace)::IndVarSimplify::run(llvm::Loop*)
(.part.476)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x25213d7)
#25 0x0000556f743d7cd0 (anonymous
namespace)::IndVarSimplifyLegacyPass::runOnLoop(llvm::Loop*,
llvm::LPPassManager&) (.part.477)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2523cd0)
#26 0x0000556f73906dcb llvm::LPPassManager::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1a52dcb)
#27 0x0000556f73f74d09 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c0d09)
#28 0x0000556f73f74e01 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c0e01)
#29 0x0000556f73f73f61 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20bff61)
#30 0x0000556f727456ff main
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x8916ff)
#31 0x00007f7dbffe6b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#32 0x0000556f727bd51a _start
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x90951a)
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/20190925/bd0c955e/attachment.html>
More information about the llvm-bugs
mailing list