[PATCH] D46829: [BreakCriticalEdges] Require DominatorTree when using the old pass manager

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 23:35:29 PDT 2018


uabelho added a comment.

Full stacktrace when it hits the assert:

opt: ../lib/Transforms/Utils/BasicBlockUtils.cpp:337: void UpdateAnalysisInformation(llvm::BasicBlock *, llvm::BasicBlock *, ArrayRef<llvm::BasicBlock *>, llvm::DominatorTree *, llvm::LoopInfo *, bool, bool &): Assertion `DT && "DT should be available to update LoopInfo!"' failed.
Stack dump:
0.      Program arguments: build-all-Debug/bin/opt test/Transforms/Util/PR37334-break-crit-edges-require-dt.ll -o - -loop-sink -break-crit-edges -branch-prob -S -debug-pass=Executions

1. Running pass 'Function Pass Manager' on module 'test/Transforms/Util/PR37334-break-crit-edges-require-dt.ll'.
2. Running pass 'Break critical edges in CFG' on function '@f1'

#0 0x00000000035e086c llvm::sys::PrintStackTrace(llvm::raw_ostream&) /data/repo/llvm-patch/build-all-Debug/../lib/Support/Unix/Signals.inc:399:5
#1 0x00000000035e0a19 PrintStackTraceSignalHandler(void*) /data/repo/llvm-patch/build-all-Debug/../lib/Support/Unix/Signals.inc:463:1
#2 0x00000000035defc3 llvm::sys::RunSignalHandlers() /data/repo/llvm-patch/build-all-Debug/../lib/Support/Signals.cpp:50:5
#3 0x00000000035e105e SignalHandler(int) /data/repo/llvm-patch/build-all-Debug/../lib/Support/Unix/Signals.inc:253:1
#4 0x00007f291488e330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#5 0x00007f291347dc37 gsignal /build/eglibc-ripdx6/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#6 0x00007f2913481028 abort /build/eglibc-ripdx6/eglibc-2.19/stdlib/abort.c:91:0
#7 0x00007f2913476bf6 __assert_fail_base /build/eglibc-ripdx6/eglibc-2.19/assert/assert.c:92:0
#8 0x00007f2913476ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#9 0x000000000360796a UpdateAnalysisInformation(llvm::BasicBlock*, llvm::BasicBlock*, llvm::ArrayRef<llvm::BasicBlock*>, llvm::DominatorTree*, llvm::LoopInfo*, bool, bool&) /data/repo/llvm-patch/build-all-Debug/../lib/Transforms/Utils/BasicBlockUtils.cpp:338:13
#10 0x0000000003606e1f llvm::SplitBlockPredecessors(llvm::BasicBlock*, llvm::ArrayRef<llvm::BasicBlock*>, char const*, llvm::DominatorTree*, llvm::LoopInfo*, bool) /data/repo/llvm-patch/build-all-Debug/../lib/Transforms/Utils/BasicBlockUtils.cpp:519:3
#11 0x000000000360ba51 llvm::SplitCriticalEdge(llvm::TerminatorInst*, unsigned int, llvm::CriticalEdgeSplittingOptions const&) /data/repo/llvm-patch/build-all-Debug/../lib/Transforms/Utils/BreakCriticalEdges.cpp:285:23
#12 0x00000000036068b1 llvm::SplitAllCriticalEdges(llvm::Function&, llvm::CriticalEdgeSplittingOptions const&) /data/repo/llvm-patch/build-all-Debug/../lib/Transforms/Utils/BasicBlockUtils.cpp:285:13
#13 0x000000000360cab7 (anonymous namespace)::BreakCriticalEdges::runOnFunction(llvm::Function&) /data/repo/llvm-patch/build-all-Debug/../lib/Transforms/Utils/BreakCriticalEdges.cpp:54:11
#14 0x0000000002cdc95d llvm::FPPassManager::runOnFunction(llvm::Function&) /data/repo/llvm-patch/build-all-Debug/../lib/IR/LegacyPassManager.cpp:1520:23
#15 0x0000000002cdcc95 llvm::FPPassManager::runOnModule(llvm::Module&) /data/repo/llvm-patch/build-all-Debug/../lib/IR/LegacyPassManager.cpp:1541:16
#16 0x0000000002cdd47e (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /data/repo/llvm-patch/build-all-Debug/../lib/IR/LegacyPassManager.cpp:1597:23
#17 0x0000000002cdcf7b llvm::legacy::PassManagerImpl::run(llvm::Module&) /data/repo/llvm-patch/build-all-Debug/../lib/IR/LegacyPassManager.cpp:1700:16
#18 0x0000000002cdd9c1 llvm::legacy::PassManager::run(llvm::Module&) /data/repo/llvm-patch/build-all-Debug/../lib/IR/LegacyPassManager.cpp:1731:3
#19 0x0000000000c19c25 main /data/repo/llvm-patch/build-all-Debug/../tools/opt/opt.cpp:762:3
#20 0x00007f2913468f45 __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:321:0
#21 0x0000000000bde519 _start (build-all-Debug/bin/opt+0xbde519)
Abort

Adding the require to BranchProbabilityInfoWrapperPass::getAnalysisUsage makes the crash go away too, but I don't understand
why/how that is the proper solution so I'd be happy if you could explain so I can at least write a proper commit message then :)

Thanks!


https://reviews.llvm.org/D46829





More information about the llvm-commits mailing list