Issue 176951
Summary [X86] Assertion `WideRoot.getValueSizeInBits() == WideSizeInBits && "WideRootSize mismatch"' failed.
Labels backend:X86, crash-on-valid, generated by fuzzer
Assignees
Reporter XChy
    Reproducer: https://godbolt.org/z/qqEhbYK7q
Testcase:
```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define <4 x i16> @backsmith_pure_4(<32 x i64> %shuffle, <16 x i16> %0, <16 x i1> %cmp) #0 {
entry:
  %conv11 = trunc <32 x i64> %shuffle to <32 x i32>
  store <32 x i32> %conv11, ptr null, align 128
  %sext = sext <16 x i1> %cmp to <16 x i16>
  %shuffle35 = shufflevector <16 x i16> %sext, <16 x i16> %0, <8 x i32> <i32 5, i32 15, i32 4, i32 4, i32 3, i32 21, i32 5, i32 7>
  %cmp36 = icmp sgt <8 x i16> %shuffle35, zeroinitializer
  %sext37 = sext <8 x i1> %cmp36 to <8 x i16>
  %shuffle38 = shufflevector <8 x i16> zeroinitializer, <8 x i16> %sext37, <4 x i32> <i32 2, i32 13, i32 7, i32 12>
  ret <4 x i16> %shuffle38
}

attributes #0 = { "target-features"="+avx2" }
```

Dump:
```
llc: /root/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:41213: llvm::SDValue combineX86ShuffleChainWithExtract(llvm::ArrayRef<llvm::SDValue>, unsigned int, llvm::MVT, llvm::ArrayRef<int>, int, llvm::ArrayRef<const llvm::SDNode*>, bool, bool, bool, llvm::SelectionDAG&, const llvm::SDLoc&, const llvm::X86Subtarget&): Assertion `WideRoot.getValueSizeInBits() == WideSizeInBits && "WideRootSize mismatch"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@backsmith_pure_4'
 #0 0x0000000004260428 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4260428)
 #1 0x000000000425d304 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x000071bbbaa42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x000071bbbaa969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x000071bbbaa42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x000071bbbaa287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000071bbbaa2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x000071bbbaa39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x000000000244dab6 combineX86ShuffleChainWithExtract(llvm::ArrayRef<llvm::SDValue>, unsigned int, llvm::MVT, llvm::ArrayRef<int>, int, llvm::ArrayRef<llvm::SDNode const*>, bool, bool, bool, llvm::SelectionDAG&, llvm::SDLoc const&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
 #9 0x0000000002448a39 combineX86ShuffleChain(llvm::ArrayRef<llvm::SDValue>, unsigned int, llvm::MVT, llvm::ArrayRef<int>, int, llvm::ArrayRef<llvm::SDNode const*>, bool, bool, bool, llvm::SelectionDAG&, llvm::SDLoc const&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
#10 0x00000000024fe407 combineX86ShufflesRecursively(llvm::ArrayRef<llvm::SDValue>, int, unsigned int, llvm::MVT, llvm::ArrayRef<int>, llvm::ArrayRef<llvm::SDNode const*>, unsigned int, unsigned int, bool, bool, bool, llvm::SelectionDAG&, llvm::SDLoc const&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
#11 0x00000000024fccce combineX86ShufflesRecursively(llvm::ArrayRef<llvm::SDValue>, int, unsigned int, llvm::MVT, llvm::ArrayRef<int>, llvm::ArrayRef<llvm::SDNode const*>, unsigned int, unsigned int, bool, bool, bool, llvm::SelectionDAG&, llvm::SDLoc const&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
#12 0x00000000024fccce combineX86ShufflesRecursively(llvm::ArrayRef<llvm::SDValue>, int, unsigned int, llvm::MVT, llvm::ArrayRef<int>, llvm::ArrayRef<llvm::SDNode const*>, unsigned int, unsigned int, bool, bool, bool, llvm::SelectionDAG&, llvm::SDLoc const&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
#13 0x0000000002507449 combineX86ShufflesRecursively(llvm::SDValue, llvm::SelectionDAG&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
#14 0x000000000251dee5 combineShuffle(llvm::SDNode*, llvm::SelectionDAG&, llvm::TargetLowering::DAGCombinerInfo&, llvm::X86Subtarget const&) X86ISelLowering.cpp:0:0
#15 0x000000000251fc05 llvm::X86TargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x251fc05)
#16 0x0000000003e7e6ff (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#17 0x0000000003e80290 (anonymous namespace)::DAGCombiner::Run(llvm::CombineLevel) DAGCombiner.cpp:0:0
#18 0x0000000003e82ce3 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::BatchAAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3e82ce3)
#19 0x0000000003ff1d55 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3ff1d55)
#20 0x0000000003ff4b58 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3ff4b58)
#21 0x0000000003ff667c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3ff667c)
#22 0x0000000003fe1eff llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe1eff)
#23 0x00000000031271f9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#24 0x000000000377fb66 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x377fb66)
#25 0x000000000377ff11 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x377ff11)
#26 0x000000000378077f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x378077f)
#27 0x00000000008e9522 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#28 0x00000000007c50fc main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c50fc)
#29 0x000071bbbaa29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#30 0x000071bbbaa29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#31 0x00000000008de5c5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8de5c5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to