[all-commits] [llvm/llvm-project] 6b694d: [LoopVectorize] Change PredicatedBBsAfterVectoriza...

david-arm via All-commits all-commits at lists.llvm.org
Tue Jul 12 07:24:39 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b694d600aeaaf30780e48cac0b784b8bc755b56
      https://github.com/llvm/llvm-project/commit/6b694d600aeaaf30780e48cac0b784b8bc755b56
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-cost.ll

  Log Message:
  -----------
  [LoopVectorize] Change PredicatedBBsAfterVectorization to be per VF

When calculating the cost of Instruction::Br in getInstructionCost
we query PredicatedBBsAfterVectorization to see if there is a
scalar predicated block. However, this meant that the decisions
being made for a given fixed-width VF were affecting the cost for a
scalable VF. As a result we were returning InstructionCost::Invalid
pointlessly for a scalable VF that should have a low cost. I
encountered this for some loops when enabling tail-folding for
scalable VFs.

Test added here:

  Transforms/LoopVectorize/AArch64/sve-tail-folding-cost.ll

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




More information about the All-commits mailing list