<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87061>87061</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Enabling new pass manager and Printing changed IRs conflict and crash `llc`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TyeYeah
</td>
</tr>
</table>
<pre>
The option `--enable-new-pm` and `--print-changed` conflict and crash.
The option `--print-changed` can carry a value or without the value, both methods crash.
Crash has be reproduced in `llvm-18.1.2`.
It has a different stack dump than [issue-87060](https://github.com/llvm/llvm-project/issues/87060)
Reproduced with:
`/mnt/llvm-project-llvmorg-18.1.2/build/bin/llc --enable-new-pm --print-changed=quiet /mnt/data/acpi_listen.bc -o /mnt/data/acpi_listen.s`
trace:
```s
Unknown wrapped IR type
UNREACHABLE executed at /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Passes/StandardInstrumentations.cpp:265!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /mnt/llvm-project-llvmorg-18.1.2/build/bin/llc --enable-new-pm --print-changed=quiet /mnt/data/acpi_listen.bc -o /mnt/data/acpi_listen.s
#0 0x000061da3fe0bcb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:723:22
#1 0x000061da3fe0c0d9 PrintStackTraceSignalHandler(void*) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:798:1
#2 0x000061da3fe09529 llvm::sys::RunSignalHandlers() /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Signals.cpp:105:20
#3 0x000061da3fe0b550 SignalHandler(int) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/Unix/Signals.inc:413:1
#4 0x00007f2a2e842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x00007f2a2e8969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x00007f2a2e8969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x00007f2a2e8969fc pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x00007f2a2e842476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#9 0x00007f2a2e8287f3 abort ./stdlib/abort.c:81:7
#10 0x000061da3fd321dd bindingsErrorHandler(void*, char const*, bool) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Support/ErrorHandling.cpp:221:55
#11 0x000061da3f502228 (anonymous namespace)::shouldPrintIR(llvm::Any) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Passes/StandardInstrumentations.cpp:266:1
#12 0x000061da3f502285 (anonymous namespace)::unwrapAndPrint(llvm::raw_ostream&, llvm::Any) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Passes/StandardInstrumentations.cpp:271:7
#13 0x000061da3f502b05 llvm::IRChangedPrinter::generateIRRepresentation(llvm::Any, llvm::StringRef, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Passes/StandardInstrumentations.cpp:486:17
#14 0x000061da3f523dac llvm::ChangeReporter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::saveIRBeforePass(llvm::Any, llvm::StringRef, llvm::StringRef) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Passes/StandardInstrumentations.cpp:375:27
#15 0x000061da3f52b810 llvm::ChangeReporter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::registerRequiredCallbacks(llvm::PassInstrumentationCallbacks&)::'lambda'(llvm::StringRef, llvm::Any)::operator()(llvm::StringRef, llvm::Any) const /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/Passes/StandardInstrumentations.cpp:425:21
#16 0x000061da3f5456d4 void llvm::detail::UniqueFunctionBase<void, llvm::StringRef, llvm::Any>::CallImpl<llvm::ChangeReporter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::registerRequiredCallbacks(llvm::PassInstrumentationCallbacks&)::'lambda'(llvm::StringRef, llvm::Any)>(void*, llvm::StringRef, llvm::Any&) /mnt/llvm-project-llvmorg-18.1.2/llvm/include/llvm/ADT/FunctionExtras.h:221:16
#17 0x000061da3e095a8a llvm::unique_function<void (llvm::StringRef, llvm::Any)>::operator()(llvm::StringRef, llvm::Any) /mnt/llvm-project-llvmorg-18.1.2/llvm/include/llvm/ADT/FunctionExtras.h:385:62
#18 0x000061da3e969324 bool llvm::PassInstrumentation::runBeforePass<llvm::MachineFunction, llvm::detail::PassConcept<llvm::MachineFunction, llvm::MachineFunctionAnalysisManager>>(llvm::detail::PassConcept<llvm::MachineFunction, llvm::MachineFunctionAnalysisManager> const&, llvm::MachineFunction const&) const /mnt/llvm-project-llvmorg-18.1.2/llvm/include/llvm/IR/PassInstrumentation.h:241:30
#19 0x000061da3e96702b llvm::MachineFunctionPassManager::run(llvm::Module&, llvm::MachineFunctionAnalysisManager&) /mnt/llvm-project-llvmorg-18.1.2/llvm/lib/CodeGen/MachinePassManager.cpp:92:13
#20 0x000061da3bb3a5f0 RunPasses(bool, llvm::ToolOutputFile*, llvm::Module*, llvm::LLVMContext&, llvm::SmallString<0u>&, llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>*, llvm::AnalysisManager<llvm::Module>*, llvm::MachineFunctionPassManager&, llvm::MachineFunctionAnalysisManager&) /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/NewPMDriver.cpp:106:12
#21 0x000061da3bb3b402 llvm::compileModuleWithNewPM(llvm::StringRef, std::unique_ptr<llvm::Module, std::default_delete<llvm::Module>>, std::unique_ptr<llvm::MIRParser, std::default_delete<llvm::MIRParser>>, std::unique_ptr<llvm::TargetMachine, std::default_delete<llvm::TargetMachine>>, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>, llvm::LLVMContext&, llvm::TargetLibraryInfoImpl const&, bool, llvm::StringRef, llvm::CodeGenFileType) /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/NewPMDriver.cpp:226:14
#22 0x000061da3bb1625b compileModule(char**, llvm::LLVMContext&) /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/llc.cpp:654:34
#23 0x000061da3bb142da main /mnt/llvm-project-llvmorg-18.1.2/llvm/tools/llc/llc.cpp:412:35
#24 0x00007f2a2e829d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#25 0x00007f2a2e829e40 call_init ./csu/../csu/libc-start.c:128:20
#26 0x00007f2a2e829e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#27 0x000061da3bb12fa5 _start (/mnt/llvm-project-llvmorg-18.1.2/build/bin/llc+0xae0fa5)
Aborted (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVtz2joe_zTKiwZGlu8PPBAS9jDTns2QdHf2iZEtAdoKyZXkJnz7HckGbENSTnrSsw-nkym2Lv_L73-1RIzhG8nYBMS3IL67IbXdKj152rP_MLK9KRTdT562DKrKciUhSNBoxCQpBBtJ9jyqdiBBkEjazFSaSzsqt0RuGHUzpZJrwUvrl5SamO0YoDuApkOa5zuJhCXReg8J_E5EzaDS8JnbraottFvWDAI8g4WyW7hjdquo6fGYuWe4JQYWDGpWaUXrklHIPU8hvu9GQTYOxhgkqN2ysH49gZSv10wzaaGxpPwKab2roN0SCUF8y42p2ShLUYJAfAdwtrW2MiCcAjwHeL7hdlsX41LtAJ47Nu3PqNLqv6y0AM89BQPwvCGC84Z98__yJKpT2NFtZt3K-U7aAb2Re1F6c9AGz4uaC-p-ufRrSziwGhwiHt59qzmz8MiAEksAnpOy4ivBjWVyXJRwpN5cYZyIHU2sJiXrye__TPMOv8ivUj1L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