[all-commits] [llvm/llvm-project] ed52bd: [VPlan] Get Addr computation cost with scalar type...

Elvis Wang via All-commits all-commits at lists.llvm.org
Mon Aug 25 18:04:36 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ed52bdd453e3504b8cc0aa3c8a5852681c535432
      https://github.com/llvm/llvm-project/commit/ed52bdd453e3504b8cc0aa3c8a5852681c535432
  Author: Elvis Wang <elvis.wang at sifive.com>
  Date:   2025-08-26 (Tue, 26 Aug 2025)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

  Log Message:
  -----------
  [VPlan] Get Addr computation cost with scalar type if it is uniform for gather/scatter. (NFC) (#150371)

This patch query `getAddressComputationCost()` with scalar type if the
address is uniform. This can help the cost for gather/scatter more
accurate.

In current LV, non consecutive VPWidenMemoryRecipe (gather/scatter) will
account the cost of address computation. But there are some cases that
the address is uniform across all lanes, that makes the address can be
calculated with scalar type and broadcast.

I have a followup optimization that tries to convert gather/scatter with
uniform memory access to scalar load/store + broadcast (and select if
needed). With this optimization, we can remove this temporary change.

This patch is preparation for #149955 to prevent regressions.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list