[all-commits] [llvm/llvm-project] d7a63a: [DAGCombiner] `visitFREEZE()`: restore previous be...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Dec 23 06:26:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d7a63a0421d5dfe91eace88dda1e5b20550b771c
      https://github.com/llvm/llvm-project/commit/d7a63a0421d5dfe91eace88dda1e5b20550b771c
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-12-23 (Fri, 23 Dec 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/X86/freeze-binary.ll

  Log Message:
  -----------
  [DAGCombiner] `visitFREEZE()`: restore previous behaviour on no maybe-poison operands

Lack of such operands implies that the op might be poison-producing due to
it's flags. We seem to drop them already, but the comments are confusing.

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


  Commit: d8f541efe7b40fe49664054ad0e7306641762131
      https://github.com/llvm/llvm-project/commit/d8f541efe7b40fe49664054ad0e7306641762131
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-12-23 (Fri, 23 Dec 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/X86/freeze-binary.ll

  Log Message:
  -----------
  [DAGCombiner] `visitFREEZE()`: fix handling of no maybe-poison ops

The original code was confusing. It was stripping poison-generating flags,
but the comments were saying that doing so was a TODO.

If the poison-generating flags are present, then even if all operands
are guaranteed not to be undef or poison, the whole operation may still
produce undef or poison. We can still deal with that case,
and we already do deal with it in fact, by also dropping those flags.

Refs. https://github.com/llvm/llvm-project/issues/59676


Compare: https://github.com/llvm/llvm-project/compare/550d93ab1d2e...d8f541efe7b4


More information about the All-commits mailing list