| Issue |
204522
|
| Summary |
[InstCombine] Assertion `match(ShufOp1, m_Undef()) && "Unexpected shuffle op"' failed.
|
| Labels |
llvm:instcombine,
crash-on-valid,
generated by fuzzer
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/TMxnWWz3h
```c
#include <stdint.h>
typedef int8_t v2i8 __attribute__((vector_size(2)));
v2i8 g24;
_Bool f26_ob8;
v2i8 f27();
int64_t f26()
{
int8_t v10;
g24 = f27();
lbl_cont1:
if (f26_ob8) f26_ob8 = v10;
g24 = __builtin_shufflevector(g24, g24, 3, 2);
goto lbl_cont1;
}
```
Dump at -O1/2/3/s:
```
clang: /root/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:3405: llvm::Instruction* llvm::InstCombinerImpl::visitBitCast(llvm::BitCastInst&): Assertion `match(ShufOp1, m_Undef()) && "Unexpected shuffle op"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -O1 <source>
1. <eof> parser at end of file
2. Optimizer
3. Running pass "function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-arithmetic;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>)" on module "<source>"
4. Running pass "instcombine<max-iterations=1;no-verify-fixpoint>" on function "f26"
#0 0x000000000434c4d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x434c4d8)
#1 0x0000000004349414 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4349414)
#2 0x0000000004349a34 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4349a34)
#3 0x0000000004286f78 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x00007eb31cc45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#5 0x00007eb31cc9eb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
#6 0x00007eb31cc4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#7 0x00007eb31cc288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#8 0x00007eb31cc2881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
#9 0x00007eb31cc3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x0000000003edc5c7 llvm::InstCombinerImpl::visitBitCast(llvm::BitCastInst&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3edc5c7)
#11 0x0000000003e5832c llvm::InstCombinerImpl::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e5832c)
#12 0x0000000003e597c6 combineInstructionsOverFunction(llvm::Function&, llvm::InstructionWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::OptimizationRemarkEmitter&, llvm::BlockFrequencyInfo*, llvm::BranchProbabilityInfo*, llvm::ProfileSummaryInfo*, llvm::InstCombineOptions const&) (.isra.0) InstructionCombining.cpp:0:0
#13 0x0000000003e5a96a llvm::InstCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3e5a96a)
#14 0x000000000476357e llvm::detail::PassModel<llvm::Function, llvm::InstCombinePass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x476357e)
#15 0x0000000003c86547 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c86547)
#16 0x000000000128e69e llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x128e69e)
#17 0x0000000003c850b6 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c850b6)
#18 0x000000000128e96e llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x128e96e)
#19 0x0000000003c846e7 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3c846e7)
#20 0x000000000476f3e5 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#21 0x0000000004772993 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4772993)
#22 0x0000000004e44707 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e44707)
#23 0x0000000006c27cdc clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6c27cdc)
#24 0x0000000004e44b58 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e44b58)
#25 0x000000000517d638 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x517d638)
#26 0x00000000050f936d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x50f936d)
#27 0x000000000527c1bd clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x527c1bd)
#28 0x0000000000dcc82c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xdcc82c)
#29 0x0000000000dc350a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#30 0x0000000000dc368d int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#31 0x0000000004eb7b59 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#32 0x00000000042873b4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x42873b4)
#33 0x0000000004eb81a6 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#34 0x0000000004e74b42 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e74b42)
#35 0x0000000004e75aee clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e75aee)
#36 0x0000000004e7d325 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4e7d325)
#37 0x0000000000dc8da2 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xdc8da2)
#38 0x0000000000cc8a4a main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xcc8a4a)
#39 0x00007eb31cc2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#40 0x00007eb31cc2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#41 0x0000000000dc2eb5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xdc2eb5)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs