[all-commits] [llvm/llvm-project] 1fb071: [NFC][InstCombine] Add tests for conditional negat...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Mon Jan 2 10:27:17 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fb07108d4f8606464fad98a49e2cbae7ec4ae25
      https://github.com/llvm/llvm-project/commit/1fb07108d4f8606464fad98a49e2cbae7ec4ae25
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2023-01-02 (Mon, 02 Jan 2023)

  Changed paths:
    A llvm/test/Transforms/InstCombine/conditional-negation.ll

  Log Message:
  -----------
  [NFC][InstCombine] Add tests for conditional negation via math

https://github.com/llvm/llvm-project/issues/59791


  Commit: cf58063a4069b9ff11a99fd49345c1d188813feb
      https://github.com/llvm/llvm-project/commit/cf58063a4069b9ff11a99fd49345c1d188813feb
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2023-01-02 (Mon, 02 Jan 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/test/Transforms/InstCombine/conditional-negation.ll

  Log Message:
  -----------
  [InstCombine] Canonicalize math-y conditional negation into a `select`

https://alive2.llvm.org/ce/z/vPs-gZ

This is a larger pattern than would seem necessary, with minimal being:
* `and` https://alive2.llvm.org/ce/z/q9-MqK
* `or`  https://alive2.llvm.org/ce/z/AUUEMZ
* `xor` https://alive2.llvm.org/ce/z/dm3Ume
.. so for all others, we canonicalize away from math to `select`,
but there we canonicalize in the opposite direction.

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


Compare: https://github.com/llvm/llvm-project/compare/ce1be13a868d...cf58063a4069


More information about the All-commits mailing list