[all-commits] [llvm/llvm-project] 3d2f88: [X86] Fix commuteSelect miscompile with double-use...

Timur Golubovich via All-commits all-commits at lists.llvm.org
Wed Sep 9 03:33:52 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d2f88da6e15645080d852d52c32435b62aca97b
      https://github.com/llvm/llvm-project/commit/3d2f88da6e15645080d852d52c32435b62aca97b
  Author: Timur Golubovich <timur.golubovich at intel.com>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/avx512-masked-op-fusion.ll

  Log Message:
  -----------
  [X86] Fix commuteSelect miscompile with double-used condition value (#219436)

The multi-use loop iterated `Cond->users()` which yields duplicates when
a select uses the condition in multiple operand positions. This caused a
double-commute and iterator corruption, leaving other selects with an
inverted condition but unswapped operands.

Remove the in-place mutation loop and return a new select node. The DAG
combiner visits each select independently and `getSetCC` CSEs the
inverted condition so all commuted selects share it.



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