[all-commits] [llvm/llvm-project] d12af6: [TTI] Treat AND/OR with widenable conditions as fr...

Max Kazantsev via All-commits all-commits at lists.llvm.org
Tue Mar 14 06:55:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d12af65d4626ac69faf8f56afd30971b8a2fc3b3
      https://github.com/llvm/llvm-project/commit/d12af65d4626ac69faf8f56afd30971b8a2fc3b3
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/test/Transforms/LoopUnroll/guard-cost-for-unrolling.ll

  Log Message:
  -----------
  [TTI] Treat AND/OR with widenable conditions as free of cost

Because widenable conditions with eventually lower into a constant, such instructions
as `and`, `or` etc. will also be optimized away. Treat them as free.

This is an important thing to have if we want that guards represented as experimental.guard
calls and in their explicit form (branch by `and` with widenable condition) have the same cost
for unroller and other passes like this.

Differential Revision: https://reviews.llvm.org/D146034
Reviewed By: nikic




More information about the All-commits mailing list