[PATCH] D114889: [GlobalOpt] Simplify CleanupConstantGlobalUsers()
Mikael Holmén via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 2 02:36:09 PST 2021
uabelho added a comment.
Btw, I've seen a crash starting to happen with this patch:
opt -S -o /dev/null -globalopt globalopt.ll
results in
opt: ../include/llvm/Support/Casting.h:262: typename cast_retty<X, Y>::ret_type llvm::cast(Y &) [X = llvm::Instruction, Y = llvm::WeakTrackingVH]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: build-all/bin/opt -S -o /dev/null -globalopt globalopt.ll
#0 0x0000000002c0c193 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/opt+0x2c0c193)
#1 0x0000000002c09e0e llvm::sys::RunSignalHandlers() (build-all/bin/opt+0x2c09e0e)
#2 0x0000000002c0c516 SignalHandler(int) Signals.cpp:0:0
#3 0x00007fcf42228630 __restore_rt sigaction.c:0:0
#4 0x00007fcf3f95b387 raise (/lib64/libc.so.6+0x36387)
#5 0x00007fcf3f95ca78 abort (/lib64/libc.so.6+0x37a78)
#6 0x00007fcf3f9541a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
#7 0x00007fcf3f954252 (/lib64/libc.so.6+0x2f252)
#8 0x0000000002c9db46 llvm::RecursivelyDeleteTriviallyDeadInstructionsPermissive(llvm::SmallVectorImpl<llvm::WeakTrackingVH>&, llvm::TargetLibraryInfo const*, llvm::MemorySSAUpdater*, std::function<void (llvm::Value*)>) (build-all/bin/opt+0x2c9db46)
#9 0x00000000024dedb3 CleanupConstantGlobalUsers(llvm::GlobalVariable*, llvm::DataLayout const&) GlobalOpt.cpp:0:0
#10 0x00000000024d98f1 processInternalGlobal(llvm::GlobalVariable*, llvm::GlobalStatus const&, llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>) GlobalOpt.cpp:0:0
#11 0x00000000024d9257 processGlobal(llvm::GlobalValue&, llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>) GlobalOpt.cpp:0:0
#12 0x00000000024d7258 optimizeGlobalsInModule(llvm::Module&, llvm::DataLayout const&, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>, llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>, llvm::function_ref<llvm::BlockFrequencyInfo& (llvm::Function&)>, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>) GlobalOpt.cpp:0:0
#13 0x00000000024d57ee llvm::GlobalOptPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x24d57ee)
#14 0x0000000002f0067d llvm::detail::PassModel<llvm::Module, llvm::GlobalOptPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) crtstuff.c:0:0
#15 0x0000000002395088 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x2395088)
#16 0x000000000078d022 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) (build-all/bin/opt+0x78d022)
#17 0x000000000079fbad main (build-all/bin/opt+0x79fbad)
#18 0x00007fcf3f947555 __libc_start_main (/lib64/libc.so.6+0x22555)
#19 0x000000000078846c _start (build-all/bin/opt+0x78846c)
Abort
F20848417: globalopt.ll <https://reviews.llvm.org/F20848417>
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114889/new/
https://reviews.llvm.org/D114889
More information about the llvm-commits
mailing list