[all-commits] [llvm/llvm-project] 7ec6f1: [AMDGPU] Cost of i8 vector insert/extract is free ...

Brendon Cahoon via All-commits all-commits at lists.llvm.org
Thu May 7 08:29:22 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ec6f177111478c0436f773ba9d836b4afaac2c6
      https://github.com/llvm/llvm-project/commit/7ec6f177111478c0436f773ba9d836b4afaac2c6
  Author: Brendon Cahoon <Brendon.Cahoon at amd.com>
  Date:   2026-05-07 (Thu, 07 May 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/AMDGPU/div.ll
    M llvm/test/Analysis/CostModel/AMDGPU/extractelement.ll
    M llvm/test/Analysis/CostModel/AMDGPU/insertelement.ll
    M llvm/test/Analysis/CostModel/AMDGPU/rem.ll
    A llvm/test/CodeGen/AMDGPU/extract-i8-codegen.ll
    A llvm/test/CodeGen/AMDGPU/i8-extract-cost-comparison.ll
    M llvm/test/Transforms/SLPVectorizer/AMDGPU/vectorize-i8.ll
    M llvm/test/Transforms/VectorCombine/AMDGPU/extract-insert-chain-to-shuffles.ll
    M llvm/test/Transforms/VectorCombine/AMDGPU/extract-insert-i8.ll
    A llvm/test/Transforms/VectorCombine/AMDGPU/no-scalarize-vector-extract.ll

  Log Message:
  -----------
  [AMDGPU] Cost of i8 vector insert/extract is free in some cases (#194991)

Reduce the cost of i8 vector insert and extract elements to avoid
scalarization in VectorCombine.

It is impossible to know during VectorCombine if an extract element will
require additional instructions or be free. There is a lot of additional context
needed to make that assessment. For example, what instructions are using
the extract elements or what other extract element index values occur. This
patch chooses some cases that likely do not require instructions, which
reduces the overall cost and avoids scalarization. Because of this chance, there
are SLP vectorization opportunities that are missed. In general, those missed
SLP vectorization cases require scalarization during code generation, and the
compiler ends up generating the same code with and without SLP vectorization.



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