[all-commits] [llvm/llvm-project] 3d549d: [LV] Pass compare predicate to getCmpSelInstrCost.

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Mon Dec 6 03:42:52 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d549dddf75b6ff9e0ec8c053677750bde4226ea
      https://github.com/llvm/llvm-project/commit/3d549dddf75b6ff9e0ec8c053677750bde4226ea
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2021-12-06 (Mon, 06 Dec 2021)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/select-costs.ll

  Log Message:
  -----------
  [LV] Pass compare predicate to getCmpSelInstrCost.

If the condition of a select is a compare, pass its predicate to
TTI::getCmpSelInstrCost to get a more accurate cost value instead
of passing BAD_ICMP_PREDICATE.

I noticed that the commit message from D90070 had a comment about the
vectorized select predicate possibly being composed of other compares with
different predicate values, but I wasn't able to construct an example
where this was an actual issue. If this is an issue, I guess we could
add another check that the block isn't predicated for any reason.

Reviewed By: dmgreen, fhahn

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




More information about the All-commits mailing list