[all-commits] [llvm/llvm-project] bc4910: [InstCombine] Don't handle constants in de morgan ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jul 11 06:19:11 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc491030154f2583f3ea0d22ee0b249f45cedbac
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-07-11 (Tue, 11 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    A llvm/test/Transforms/InstCombine/pr63791.ll

  Log Message:
  [InstCombine] Don't handle constants in de morgan folds (PR63791)

If the and/or operand is an immediate constant, it will get folded
away anyway. Don't try to freely invert those operands.

A particularly degenerate case of this arises when both operands
are constant and the result is a constant, in which case we try
to invert users of a constant, resulting in an assertion failure.

Fixes https://github.com/llvm/llvm-project/issues/63791.

More information about the All-commits mailing list