[SLP]Fix cost of the broadcast buildvector/gather.
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 21 Dec 2022 21:38:38 +0000 (13:38 -0800)
committerAlexey Bataev <a.bataev@outlook.com>
Fri, 6 Jan 2023 17:25:05 +0000 (09:25 -0800)
commit9b5f62685ab447ba9d3ea8ac2616e0c76a44d21b
tree24d6d2ae06c162cfe37ba2d37745ca8d2bf6f281
parent9f087ba05b34eba6bd8a96659cc69283458f7b00
[SLP]Fix cost of the broadcast buildvector/gather.

Need to include the cost of the initial insertelement to the cost of the
broadcasts. Also, need to adjust the cost of the gather/buildvector if
the element is inserted into poison/undef vector.

Differential Revision: https://reviews.llvm.org/D140498
50 files changed:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
llvm/lib/Target/AMDGPU/R600TargetTransformInfo.cpp
llvm/lib/Target/AMDGPU/R600TargetTransformInfo.h
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/lib/Target/ARM/ARMTargetTransformInfo.h
llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.h
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/lib/Target/X86/X86TargetTransformInfo.h
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Analysis/CostModel/X86/loop_v2-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/loop_v2.ll
llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost.ll
llvm/test/Analysis/CostModel/X86/vector-insert-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/vector-insert.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-codesize.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-cost.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-latency.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-sizelatency.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-codesize.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-cost.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-latency.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-sizelatency.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-codesize.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-cost.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-latency.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-sizelatency.ll
llvm/test/Transforms/SLPVectorizer/X86/cse.ll
llvm/test/Transforms/SLPVectorizer/X86/malformed_phis.ll
llvm/test/Transforms/SLPVectorizer/X86/remark_gather-load-redux-cost.ll
llvm/test/Transforms/SLPVectorizer/X86/used-reduced-op.ll