[llvm-bugs] [Bug 37434] New: CoroCleanup assertion failure with example code from the docs

via llvm-bugs llvm-bugs at lists.llvm.org
Sat May 12 12:42:10 PDT 2018


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

            Bug ID: 37434
           Summary: CoroCleanup assertion failure with example code from
                    the docs
           Product: new-bugs
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: aykevanlaethem at gmail.com
                CC: llvm-bugs at lists.llvm.org

I'm trying to get the first example coroutine in the documentation to
compile/optimize:
https://llvm.org/docs/Coroutines.html#coroutine-representation

It looks like -coro-cleanup doesn't work properly. Removing this pass from the
command line results in a successful compilation.

The LLVM version I'm using is trunk from a week ago.
I've attached the IR file that I'm trying to compile, which is basically a copy
from the docs where I've added some missing function declarations.

Unfortunately, bugpoint doesn't seem to work: it doesn't recognize the
coroutine passes. These would be useful to have for another bug probably
somewhere in my own code, but that's a separate issue.


$ path/to/llvm_build/bin/opt -debug-pass=Arguments -O1 -coro-early -coro-split
-coro-elide -coro-cleanup -verify-each -disable-output corotest.ll
Pass Arguments:  -tti -tbaa -scoped-noalias -assumption-cache-tracker
-targetlibinfo -verify -ee-instrument -simplifycfg -domtree -sroa -early-cse
-lower-expect
Pass Arguments:  -targetlibinfo -tti -tbaa -scoped-noalias
-assumption-cache-tracker -profile-summary-info -forceattrs -inferattrs -ipsccp
-called-value-propagation -globalopt -domtree -mem2reg -deadargelim -domtree
-basicaa -aa -loops -lazy-branch-prob -lazy-block-freq -opt-remark-emitter
-instcombine -simplifycfg -basiccg -globals-aa -prune-eh -always-inline
-functionattrs -domtree -sroa -basicaa -aa -memoryssa -early-cse-memssa
-speculative-execution -domtree -basicaa -aa -lazy-value-info -jump-threading
-correlated-propagation -simplifycfg -domtree -basicaa -aa -loops
-lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instcombine
-libcalls-shrinkwrap -loops -branch-prob -block-freq -lazy-branch-prob
-lazy-block-freq -opt-remark-emitter -pgo-memop-opt -domtree -basicaa -aa
-loops -lazy-branch-prob -lazy-block-freq -opt-remark-emitter -tailcallelim
-simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa-verification
-lcssa -basicaa -aa -scalar-evolution -loop-rotate -licm -loop-unswitch
-simplifycfg -domtree -basicaa -aa -loops -lazy-branch-prob -lazy-block-freq
-opt-remark-emitter -instcombine -loop-simplify -lcssa-verification -lcssa
-scalar-evolution -indvars -loop-idiom -loop-deletion -loop-unroll -memdep
-memcpyopt -sccp -domtree -demanded-bits -bdce -basicaa -aa -loops
-lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instcombine
-lazy-value-info -jump-threading -correlated-propagation -domtree -basicaa -aa
-memdep -dse -loops -loop-simplify -lcssa-verification -lcssa -aa
-scalar-evolution -licm -postdomtree -adce -simplifycfg -domtree -basicaa -aa
-loops -lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instcombine
-barrier -basiccg -rpo-functionattrs -globalopt -globaldce -basiccg -globals-aa
-float2int -domtree -loops -loop-simplify -lcssa-verification -lcssa -basicaa
-aa -scalar-evolution -loop-rotate -loop-accesses -lazy-branch-prob
-lazy-block-freq -opt-remark-emitter -loop-distribute -branch-prob -block-freq
-scalar-evolution -basicaa -aa -loop-accesses -demanded-bits -lazy-branch-prob
-lazy-block-freq -opt-remark-emitter -loop-vectorize -loop-simplify
-scalar-evolution -aa -loop-accesses -loop-load-elim -basicaa -aa
-lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instcombine
-simplifycfg -domtree -basicaa -aa -loops -lazy-branch-prob -lazy-block-freq
-opt-remark-emitter -instcombine -loop-simplify -lcssa-verification -lcssa
-scalar-evolution -loop-unroll -lazy-branch-prob -lazy-block-freq
-opt-remark-emitter -instcombine -loop-simplify -lcssa-verification -lcssa
-scalar-evolution -licm -alignment-from-assumptions -strip-dead-prototypes
-domtree -loops -branch-prob -block-freq -loop-simplify -lcssa-verification
-lcssa -basicaa -aa -scalar-evolution -branch-prob -block-freq -loop-sink
-lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instsimplify
-div-rem-pairs -simplifycfg -coro-early -verify -basiccg -coro-split -verify
-domtree -basicaa -aa -coro-elide -verify -coro-cleanup -verify
Pass Arguments:  -targetlibinfo -domtree -loops -branch-prob -block-freq
Pass Arguments:  -targetlibinfo -domtree -loops -branch-prob -block-freq
Pass Arguments:  -assumption-cache-tracker -tti -simplifycfg
opt: /home/ayke/src/llvm.org/llvm/lib/Transforms/Coroutines/CoroInstr.h:274:
llvm::CoroSaveInst* llvm::CoroSuspendInst::getCoroSave() const: Assertion
`isa<ConstantTokenNone>(Arg)' failed.
Stack dump:
0.      Program arguments: path/to/llvm_build/bin/opt -debug-pass=Arguments -O1
-coro-early -coro-split -coro-elide -coro-cleanup -verify-each -disable-output
corotest.ll 
1.      Running pass 'CallGraph Pass Manager' on module 'corotest.ll'.
#0 0x000055ae1fa85226 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/ayke/src/llvm.org/llvm/lib/Support/Unix/Signals.inc:399:0
#1 0x000055ae1fa852b9 PrintStackTraceSignalHandler(void*)
/home/ayke/src/llvm.org/llvm/lib/Support/Unix/Signals.inc:463:0
#2 0x000055ae1fa8377a llvm::sys::RunSignalHandlers()
/home/ayke/src/llvm.org/llvm/lib/Support/Signals.cpp:49:0
#3 0x000055ae1fa84baa SignalHandler(int)
/home/ayke/src/llvm.org/llvm/lib/Support/Unix/Signals.inc:253:0
#4 0x00007f5024cb00c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#5 0x00007f5023845fff gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fff)
#6 0x00007f502384742a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3442a)
#7 0x00007f502383ee67 (/lib/x86_64-linux-gnu/libc.so.6+0x2be67)
#8 0x00007f502383ef12 (/lib/x86_64-linux-gnu/libc.so.6+0x2bf12)
#9 0x000055ae1f380827 llvm::CoroSuspendInst::getCoroSave() const
/home/ayke/src/llvm.org/llvm/lib/Transforms/Coroutines/CoroInstr.h:275:0
#10 0x000055ae1f3800b8 llvm::coro::Shape::buildFrom(llvm::Function&)
/home/ayke/src/llvm.org/llvm/lib/Transforms/Coroutines/Coroutines.cpp:316:0
#11 0x000055ae1f38cd43 llvm::coro::Shape::Shape(llvm::Function&)
/home/ayke/src/llvm.org/llvm/lib/Transforms/Coroutines/CoroInternal.h:97:0
#12 0x000055ae1f38baf5 splitCoroutine(llvm::Function&, llvm::CallGraph&,
llvm::CallGraphSCC&)
/home/ayke/src/llvm.org/llvm/lib/Transforms/Coroutines/CoroSplit.cpp:713:0
#13 0x000055ae1f38c87b (anonymous
namespace)::CoroSplit::runOnSCC(llvm::CallGraphSCC&)
/home/ayke/src/llvm.org/llvm/lib/Transforms/Coroutines/CoroSplit.cpp:850:0
#14 0x000055ae1ea31b5c (anonymous
namespace)::CGPassManager::RunPassOnSCC(llvm::Pass*, llvm::CallGraphSCC&,
llvm::CallGraph&, bool&, bool&)
/home/ayke/src/llvm.org/llvm/lib/Analysis/CallGraphSCCPass.cpp:133:0
#15 0x000055ae1ea32c93 (anonymous
namespace)::CGPassManager::RunAllPassesOnSCC(llvm::CallGraphSCC&,
llvm::CallGraph&, bool&)
/home/ayke/src/llvm.org/llvm/lib/Analysis/CallGraphSCCPass.cpp:423:0
#16 0x000055ae1ea32f8d (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
/home/ayke/src/llvm.org/llvm/lib/Analysis/CallGraphSCCPass.cpp:479:0
#17 0x000055ae1f2c0a27 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/ayke/src/llvm.org/llvm/lib/IR/LegacyPassManager.cpp:1597:0
#18 0x000055ae1f2c10db llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/ayke/src/llvm.org/llvm/lib/IR/LegacyPassManager.cpp:1700:0
#19 0x000055ae1f2c12d3 llvm::legacy::PassManager::run(llvm::Module&)
/home/ayke/src/llvm.org/llvm/lib/IR/LegacyPassManager.cpp:1732:0
#20 0x000055ae1d704dba main
/home/ayke/src/llvm.org/llvm/tools/opt/opt.cpp:761:0
#21 0x00007f50238332e1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202e1)
#22 0x000055ae1d6d18ea _start (path/to/llvm_build/bin/opt+0x134e8ea)

-- 
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/20180512/81ee9946/attachment.html>


More information about the llvm-bugs mailing list