[all-commits] [llvm/llvm-project] 9278dd: [LoopVectorize] Fix zext/sext cost calculations wh...

david-arm via All-commits all-commits at lists.llvm.org
Thu Apr 6 01:52:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9278dd7b2bd9bab4a7122b074e43e9bdd0d5d20f
      https://github.com/llvm/llvm-project/commit/9278dd7b2bd9bab4a7122b074e43e9bdd0d5d20f
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2023-04-06 (Thu, 06 Apr 2023)

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

  Log Message:
  -----------
  [LoopVectorize] Fix zext/sext cost calculations when types are shrunk

In getInstructionCost if we know a zext/sext is going to be shrunk
we should only be changing the destination type, and leave the
source type unchanged. For example, we may change a zext from

  zext <16 x i8> %a to <16 x i32>

to

  zext <16 x i8> %a to <16 x i16>

However, we were previously calculating the cost for doing

  zext <16 x i16> %a to <16 x i16>

which is incorrect.

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




More information about the All-commits mailing list