Skip to content

behavior tests are tripping an LLVM assert when CPU has avx512f feature #17514

@andrewrk

Description

@andrewrk

zig version: 0.12.0-dev.903+7aa85691b

$ stage4/bin/zig test ../test/behavior.zig -I../test -mcpu=x86_64+avx512f
LLVM Emit Object... zig: /home/andy/Downloads/llvm-project-17/llvm/lib/Target/X86/X86ISelLowering.cpp:25856: llvm::SDValue LowerVSETCC(llvm::SDValue, const llvm::X86Subtarget&, llvm::SelectionDAG&): Assertion `(VTOp0.getScalarSizeInBits() >= 32 || Subtarget.hasBWI()) && "Unexpected operand type"' failed.
Aborted (core dumped)

Not sure what Zig code is triggering this yet but it seems related to vectors:

Thread 1 "zig" received signal SIGABRT, Aborted.
0x00007ffff7d64adc in __pthread_kill_implementation ()
   from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7d64adc in __pthread_kill_implementation ()
   from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#1  0x00007ffff7d15cb6 in raise ()
   from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#2  0x00007ffff7cff8ba in abort ()
   from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#3  0x00007ffff7cff7d9 in __assert_fail_base.cold ()
   from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#4  0x00007ffff7d0e9c6 in __assert_fail ()
   from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#5  0x000000000c1241e6 in LowerVSETCC(llvm::SDValue, llvm::X86Subtarget const&, llvm::SelectionDAG&) ()
#6  0x000000000aa88ea7 in (anonymous namespace)::VectorLegalizer::LegalizeOp(llvm::SDValue) ()
#7  0x000000000aa8753d in (anonymous namespace)::VectorLegalizer::LegalizeOp(llvm::SDValue) ()
#8  0x000000000aa8a5b3 in llvm::SelectionDAG::LegalizeVectors() ()
#9  0x000000000a9926a8 in llvm::SelectionDAGISel::CodeGenAndEmitDAG() ()
#10 0x000000000a996567 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) ()
#11 0x000000000a9981c4 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone .part.0] ()
#12 0x000000000c337d8c in (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
#13 0x0000000009ca9985 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) [clone .part.0] ()
#14 0x0000000008b75976 in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
#15 0x0000000008b75ba1 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#16 0x0000000008b76463 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#17 0x000000000881cbc5 in ZigLLVMTargetMachineEmitToFile ()
#18 0x0000000006ae9add in codegen.llvm.Object.flushModule (self=0xfb27100, comp=0xfb24570,
    prog_node=0x7ffffffefe38) at /home/andy/Downloads/zig/src/codegen/llvm.zig:1277

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86_6464-bit x86backend-llvmThe LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorupstreamAn issue with a third party project that Zig uses.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions