[llvm-bugs] [Bug 48060] New: LoopFuser crashes with Assertion `FC1.Preheader == (FC0.Peeled ? FC0.ExitBlock->getUniqueSuccessor() : FC0.ExitBlock)' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Nov 3 04:42:30 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=48060
Bug ID: 48060
Summary: LoopFuser crashes with Assertion `FC1.Preheader ==
(FC0.Peeled ? FC0.ExitBlock->getUniqueSuccessor() :
FC0.ExitBlock)' failed.
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Loop Optimizer
Assignee: unassignedbugs at nondot.org
Reporter: cszide at 163.com
CC: llvm-bugs at lists.llvm.org
Created attachment 24125
--> https://bugs.llvm.org/attachment.cgi?id=24125&action=edit
small.bc
$clang -v
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
168db92465c504974274302a6a1a5d4a1580ccfe)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/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.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$clang -O3 -c -emit-llvm -femit-all-decls -mllvm -disable-llvm-optzns small.c
-o small.bc
$opt -sroa -loop-rotate -newgvn -jump-threading -loop-unroll -early-cse
-instcombine -loop-fusion small.bc -o small-opt.bc
opt:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp:1330:
llvm::Loop* {anonymous}::LoopFuser::performFusion(const
{anonymous}::FusionCandidate&, const {anonymous}::FusionCandidate&): Assertion
`FC1.Preheader == (FC0.Peeled ? FC0.ExitBlock->getUniqueSuccessor() :
FC0.ExitBlock)' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0. Program arguments:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt -sroa
-loop-rotate -newgvn -jump-threading -loop-unroll -early-cse -instcombine
-loop-fusion small.bc -o small-opt.bc
1. Running pass 'Function Pass Manager' on module 'small.bc'.
2. Running pass 'Loop Fusion' on function '@b'
#0 0x0000563c8f7d5f1c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2beff1c)
#1 0x0000563c8f7d3bf4 llvm::sys::RunSignalHandlers()
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2bedbf4)
#2 0x0000563c8f7d3d63 SignalHandler(int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2bedd63)
#3 0x00007f9b6e00f8a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x128a0)
#4 0x00007f9b6ccc1f47 raise
/build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f9b6ccc38b1 abort /build/glibc-2ORdQG/glibc-2.27/stdlib/abort.c:81:0
#6 0x00007f9b6ccb342a __assert_fail_base
/build/glibc-2ORdQG/glibc-2.27/assert/assert.c:89:0
#7 0x00007f9b6ccb34a2 (/lib/x86_64-linux-gnu/libc.so.6+0x304a2)
#8 0x0000563c8f6d4f13 (anonymous
namespace)::LoopFuser::performFusion((anonymous namespace)::FusionCandidate
const&, (anonymous namespace)::FusionCandidate const&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2aeef13)
#9 0x0000563c8f6d7add (anonymous namespace)::LoopFuser::fuseCandidates()
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2af1add)
#10 0x0000563c8f6d8bc3 (anonymous
namespace)::LoopFuser::fuseLoops(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2af2bc3)
#11 0x0000563c8f6da953 (anonymous
namespace)::LoopFuseLegacy::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2af4953)
#12 0x0000563c8effaa48 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2414a48)
#13 0x0000563c8effb549 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x2415549)
#14 0x0000563c8effa2c6 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x24142c6)
#15 0x0000563c8d4633da main
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x87d3da)
#16 0x00007f9b6cca4b97 __libc_start_main
/build/glibc-2ORdQG/glibc-2.27/csu/../csu/libc-start.c:344:0
#17 0x0000563c8d5178ea _start
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm-project/build/bin/opt+0x9318ea)
Aborted (core dumped)
$cat small.c
short a=0;
void b() {
int c = 2;
for (; c <= 58; c += 5) {
if (a)
break;
for (; a != 8; a++)
;
}
}
I also verify this bug using godbolt, which produces the same outputs.
--
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/20201103/048ec25d/attachment.html>
More information about the llvm-bugs
mailing list