[llvm-bugs] [Bug 39160] New: Assertion failure /home/mkazantsev/work/llvm/include/llvm/IR/Instructions.h:3123: llvm::Value* llvm::PHINode::getIncomingValueForBlock(const llvm::BasicBlock*) const: Assertion `Idx >= 0 && "Invalid basic block argument!"' failed. Stack dump:
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Oct 3 04:12:32 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=39160
Bug ID: 39160
Summary: Assertion failure
/home/mkazantsev/work/llvm/include/llvm/IR/Instruction
s.h:3123: llvm::Value*
llvm::PHINode::getIncomingValueForBlock(const
llvm::BasicBlock*) const: Assertion `Idx >= 0 &&
"Invalid basic block argument!"' failed. Stack dump:
Product: new-bugs
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: max.kazantsev at azul.com
CC: llvm-bugs at lists.llvm.org
Created attachment 20953
--> https://bugs.llvm.org/attachment.cgi?id=20953&action=edit
Reproducer IR
Download the IR in attachment and run
opt -loop-vectorizer -S ./ir.ll
It fails an assertion in SCEV like this:
opt: /home/mkazantsev/work/llvm/include/llvm/IR/Instructions.h:3123:
llvm::Value* llvm::PHINode::getIncomingValueForBlock(const llvm::BasicBlock*)
const: Assertion `Idx >= 0 && "Invalid basic block argument!"' failed.
Stack dump:
0. Program arguments: /home/mkazantsev/work/llvm/build/buildRA/bin/opt
-loop-vectorize -S ./ir.ll
1. Running pass 'Function Pass Manager' on module './ir.ll'.
2. Running pass 'Loop Vectorization' on function '@barney'
#0 0x00007f663bb828aa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/mkazantsev/work/llvm/lib/Support/Unix/Signals.inc:494:0
#1 0x00007f663bb80e6a llvm::sys::RunSignalHandlers()
/home/mkazantsev/work/llvm/lib/Support/Signals.cpp:67:0
#2 0x00007f663bb80f9d SignalHandler(int)
/home/mkazantsev/work/llvm/lib/Support/Unix/Signals.inc:353:0
#3 0x00007f663ae9b390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f663a254428 gsignal
/build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f663a25602a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f663a24cbd7 __assert_fail_base
/build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0
#7 0x00007f663a24cc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x00007f663bd3efd7
(/home/mkazantsev/work/llvm/build/buildRA/bin/../lib/libLLVM-8svn.so+0xc97fd7)
#9 0x00007f663cabf807
llvm::ScalarEvolution::isImpliedViaMerge(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, unsigned int)
/home/mkazantsev/work/llvm/lib/Analysis/ScalarEvolution.cpp:10006:0
#10 0x00007f663cabfe42
llvm::ScalarEvolution::isImpliedViaOperations(llvm::CmpInst::Predicate,
llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*,
unsigned int)
/home/mkazantsev/work/llvm/lib/Analysis/ScalarEvolution.cpp:10278:0
#11 0x00007f663cac0241
llvm::ScalarEvolution::isImpliedViaMerge(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, unsigned
int)::'lambda0'(llvm::SCEV const*, llvm::SCEV const*)::operator()(llvm::SCEV
const*, llvm::SCEV const*) const
/home/mkazantsev/work/llvm/lib/Analysis/ScalarEvolution.cpp:9965:0
#12 0x00007f663cabf820
llvm::ScalarEvolution::isImpliedViaMerge(llvm::CmpInst::Predicate, llvm::SCEV
const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, unsigned int)
/home/mkazantsev/work/llvm/lib/Analysis/ScalarEvolution.cpp:10007:0
#13 0x00007f663cabfe42
llvm::ScalarEvolution::isImpliedViaOperations(llvm::CmpInst::Predicate,
llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*,
unsigned int)
/home/mkazantsev/work/llvm/lib/Analysis/ScalarEvolution.cpp:10278:0
#14 0x00007f663cac02cd
llvm::ScalarEvolution::isImpliedCondOperandsHelper(llvm::CmpInst::Predicate,
llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*)
/home/mkazantsev/work/llvm/lib/Analysis/ScalarEvolution.cpp:10336:0
The failure is gone is the following patch is reverted:
commit 4090ce2a163b88ef04a8f1a72e421f154c98a1eb
Author: Justin Lebar <jlebar at google.com>
Date: Thu Jun 14 17:13:35 2018 +0000
[SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more
circumstances.
Summary:
Previously we would do this simplification only if it did not introduce
any new truncs (excepting new truncs which replace other cast ops).
This change weakens this condition: If the number of truncs stays the
same, but we're able to transform trunc(X + Y) to X + trunc(Y), that's
still simpler, and it may open up additional transformations.
While we're here, also clean up some duplicated code.
Reviewers: sanjoy
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D48160
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334736
91177308-0d34-0410-b5e6-96231b3b80d8
Note that after looking into the patch's code I don't see any obvious problem
there, so it might be not causing the bug but exposing something that's already
there.
--
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/20181003/2504f39d/attachment.html>
More information about the llvm-bugs
mailing list