[all-commits] [llvm/llvm-project] c89d9d: [TTI] Consider select form of and/or i1 as having ...

Juneyoung Lee via All-commits all-commits at lists.llvm.org
Mon Mar 1 09:18:42 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c89d9d8a48c08ffc28e0dbd7372b7070d48fd587
      https://github.com/llvm/llvm-project/commit/c89d9d8a48c08ffc28e0dbd7372b7070d48fd587
  Author: Juneyoung Lee <aqjune at gmail.com>
  Date:   2021-03-02 (Tue, 02 Mar 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    A llvm/test/Analysis/CostModel/AArch64/logicalop.ll
    A llvm/test/Analysis/CostModel/AMDGPU/logicalop.ll
    A llvm/test/Analysis/CostModel/ARM/logicalop.ll
    A llvm/test/Analysis/CostModel/PowerPC/logicalop.ll
    A llvm/test/Analysis/CostModel/RISCV/logicalop.ll
    A llvm/test/Analysis/CostModel/SystemZ/logicalop.ll
    A llvm/test/Analysis/CostModel/X86/logicalop.ll

  Log Message:
  -----------
  [TTI] Consider select form of and/or i1 as having arithmetic cost

This is a patch that updates the cost of `select i1 a, b, false` to be equivalent to that of `and i1 a, b`
as well as the cost of `select i1 a, true, b` equivalent to `or i1 a, b`.

Until now, these selects were folded into and/or i1 by InstCombine, but the transformation is poison-unsafe.
This is a step towards removing the unsafe transformation. D93065 has relevant transformations linked.
These selects should be translated into the assemblies as and/or i1 do in the same manner. The cost should be equivalent.

Reviewed By: spatel

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




More information about the All-commits mailing list