[all-commits] [llvm/llvm-project] ca78b5: [SelectOpt] Don't treat LogicalAnd/LogicalOr as se...

David Green via All-commits all-commits at lists.llvm.org
Thu Nov 24 06:30:14 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca78b5601466f8515f5f958ef8e63d787d9d812e
      https://github.com/llvm/llvm-project/commit/ca78b5601466f8515f5f958ef8e63d787d9d812e
  Author: David Green <david.green at arm.com>
  Date:   2022-11-24 (Thu, 24 Nov 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectOptimize.cpp
    A llvm/test/CodeGen/AArch64/selectopt-logical.ll

  Log Message:
  -----------
  [SelectOpt] Don't treat LogicalAnd/LogicalOr as selects

A `select i1 %c, i1 true, i1 %d` is just an or and a `select i1 %c, i1 %d, i1 false`
is just an and. There are better treated as such in the logic of SelectOpt, allowing
the backend to optimize them to and/or directly.

Differential Revision: https://reviews.llvm.org/D138490




More information about the All-commits mailing list