[all-commits] [llvm/llvm-project] 1a644b: [X86] Fix assertion in AVX512 setcc combine due to...

Abhishek Kaushik via All-commits all-commits at lists.llvm.org
Mon Sep 22 16:54:08 PDT 2025


  Branch: refs/heads/release/21.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a644bc50948145af162766a5c4d066bf89d2eb6
      https://github.com/llvm/llvm-project/commit/1a644bc50948145af162766a5c4d066bf89d2eb6
  Author: Abhishek Kaushik <abhishek.kaushik at intel.com>
  Date:   2025-09-22 (Mon, 22 Sep 2025)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/kmov.ll

  Log Message:
  -----------
  [X86] Fix assertion in AVX512 setcc combine due to invalid APInt mask width (#155775)

The AVX512 setcc combine in X86ISelLowering was calling
`APInt::getLowBitsSet` with a mask width (`Len`) that could exceed the
bit width of the broadcasted scalar operand
(`BroadcastOpVT.getSizeInBits()`), leading to assertion failures.

This patch replaces `Len` with the number of defined (non-undef)
elements in the constant pool vector.

This ensures the generated mask is valid and avoids crashes when the
constant pool contains more elements than the scalar bit width can
represent.

Fixes #155762

(cherry picked from commit 33b2c26560f7083755fd0fabe1f74cddf02eb0a4)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list