Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[x86] Cannot select X86ISD::VZEXT_MOVL when targeting Intel Sapphire Rapids #59628

Closed
HazyFish opened this issue Dec 21, 2022 · 2 comments
Closed
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@HazyFish
Copy link
Contributor

Description

The following code crashes x86 backend with "Cannot select X86ISD::VZEXT_MOVL" when targeting sapphirerapids CPU.

The code can successfully compile without specifying CPU.

Minimal Reproduction

https://godbolt.org/z/asEvGcG7e

Code

define <8 x i16> @f(i16 %0) {
BB:
  %I1 = insertelement <8 x i16> zeroinitializer, i16 %0, i16 0
  %I2 = insertelement <8 x i16> %I1, i16 0, i16 %0
  ret <8 x i16> %I2
}

Stack Trace

LLVM ERROR: Cannot select: t37: v8i16 = X86ISD::VZEXT_MOVL t48
  t48: v8i16 = X86ISD::VBROADCAST t3
    t3: i16 = truncate t2
      t2: i32,ch = CopyFromReg t0, Register:i32 %0
        t1: i32 = Register %0
In function: f
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: ./llvm-project-latest/build-debug/bin/llc -mtriple=x86_64 -mcpu=sapphirerapids ./crash-reports/dagisel-x86_64/sapphirerapids/1.ll
1.	Running pass 'Function Pass Manager' on module './crash-reports/dagisel-x86_64/sapphirerapids/1.ll'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@f'
 #0 0x00007f94f47e0f2a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/Support/Unix/Signals.inc:567:11
 #1 0x00007f94f47e10db PrintStackTraceSignalHandler(void*) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/Support/Unix/Signals.inc:641:1
 #2 0x00007f94f47df756 llvm::sys::RunSignalHandlers() /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/Support/Signals.cpp:104:5
 #3 0x00007f94f47e1805 SignalHandler(int) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/Support/Unix/Signals.inc:412:1
 #4 0x00007f94f2f75980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #5 0x00007f94f2271e87 raise /build/glibc-CVJwZb/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007f94f22737f1 abort /build/glibc-CVJwZb/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007f94f4654424 llvm::report_fatal_error(llvm::Twine const&, bool) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/Support/ErrorHandling.cpp:125:5
 #8 0x00007f94f4ff0e5b /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:3817:3
 #9 0x00007f94f4fee3f2 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:3719:9
#10 0x00007f9501023b49 (anonymous namespace)::X86DAGToDAGISel::SelectCode(llvm::SDNode*) /home/henry/aflplusplus-isel/llvm-project-latest/build-debug/lib/Target/X86/X86GenDAGISel.inc:333210:1
#11 0x00007f9501019e47 (anonymous namespace)::X86DAGToDAGISel::Select(llvm::SDNode*) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:6171:1
#12 0x00007f94f4fe2199 llvm::SelectionDAGISel::DoInstructionSelection() /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1178:5
#13 0x00007f94f4fe11ea llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:949:3
#14 0x00007f94f4fdfbbd llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, bool&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:701:1
#15 0x00007f94f4fdf64d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1641:11
#16 0x00007f94f4fdcb27 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:480:3
#17 0x00007f9501007b7a (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:193:7
#18 0x00007f94f7ff51d5 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:8
#19 0x00007f94f713d676 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/IR/LegacyPassManager.cpp:1430:23
#20 0x00007f94f71424a2 llvm::FPPassManager::runOnModule(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/IR/LegacyPassManager.cpp:1476:16
#21 0x00007f94f713df49 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/IR/LegacyPassManager.cpp:1545:23
#22 0x00007f94f713dabd llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/IR/LegacyPassManager.cpp:535:16
#23 0x00007f94f7142781 llvm::legacy::PassManager::run(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/lib/IR/LegacyPassManager.cpp:1672:3
#24 0x0000000000419b16 compileModule(char**, llvm::LLVMContext&) /home/henry/aflplusplus-isel/llvm-project-latest/llvm/tools/llc/llc.cpp:737:41
#25 0x0000000000417eaa main /home/henry/aflplusplus-isel/llvm-project-latest/llvm/tools/llc/llc.cpp:418:13
#26 0x00007f94f2254c87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#27 0x00000000004176aa _start (./llvm-project-latest/build-debug/bin/llc+0x4176aa)
@HazyFish
Copy link
Contributor Author

cc @DataCorrupted

@llvmbot
Copy link
Member

llvmbot commented Dec 21, 2022

@llvm/issue-subscribers-backend-x86

@EugeneZelenko EugeneZelenko added the crash Prefer [crash-on-valid] or [crash-on-invalid] label Dec 21, 2022
CarlosAlbertoEnciso pushed a commit to SNSystems/llvm-debuginfo-analyzer that referenced this issue Dec 25, 2022
…" `VMOVSH`

For all other patterns, we consistently have both I and F variants,
let's not diverge.

Fixes llvm/llvm-project#59628
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Jun 10, 2024
…" `VMOVSH`

For all other patterns, we consistently have both I and F variants,
let's not diverge.

Fixes llvm/llvm-project#59628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

4 participants