[all-commits] [llvm/llvm-project] 54cc41: [SPIR-V] Rework duplicate tracker and tracking of ...
Vyacheslav Levytskyy via All-commits
all-commits at lists.llvm.org
Wed Mar 26 09:58:35 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 54cc4141e4e3707de88a6bb3fa8e62dccc27b66c
https://github.com/llvm/llvm-project/commit/54cc4141e4e3707de88a6bb3fa8e62dccc27b66c
Author: Vyacheslav Levytskyy <vyacheslav.levytskyy at intel.com>
Date: 2025-03-26 (Wed, 26 Mar 2025)
Changed paths:
M llvm/include/llvm/IR/IntrinsicsSPIRV.td
M llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
M llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
R llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
M llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
A llvm/lib/Target/SPIRV/SPIRVIRMapping.h
M llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp
M llvm/lib/Target/SPIRV/SPIRVInstrInfo.h
M llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.h
M llvm/lib/Target/SPIRV/SPIRVPostLegalizer.cpp
M llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
M llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp
M llvm/lib/Target/SPIRV/SPIRVUtils.cpp
M llvm/lib/Target/SPIRV/SPIRVUtils.h
M llvm/test/CodeGen/SPIRV/AtomicCompareExchange.ll
A llvm/test/CodeGen/SPIRV/GroupAndSubgroupInstructions.spvasm
M llvm/test/CodeGen/SPIRV/SampledImageRetType.ll
M llvm/test/CodeGen/SPIRV/atomicrmw.ll
M llvm/test/CodeGen/SPIRV/const-array-in-struct.ll
M llvm/test/CodeGen/SPIRV/const-composite.ll
M llvm/test/CodeGen/SPIRV/debug-info/debug-type-basic.ll
M llvm/test/CodeGen/SPIRV/debug-info/debug-type-pointer.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_add/atomicrmw_faddfsub_double.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_add/atomicrmw_faddfsub_float.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_add/atomicrmw_faddfsub_half.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_min_max/atomicrmw_fminfmax_double.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_min_max/atomicrmw_fminfmax_float.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_EXT_shader_atomic_float_min_max/atomicrmw_fminfmax_half.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_joint_matrix/cooperative_matrix_checked.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_long_composites/long-composite-construct.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_long_composites/long-constant-composite.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_long_composites/long-spec-const-composite.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_long_composites/long-type-struct.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_split_barrier/split_work_group_barrier_20.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_split_barrier/split_work_group_barrier_spirv.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_cooperative_matrix/cooperative_matrix.ll
M llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_uniform_group_instructions/uniform-group-instructions.ll
M llvm/test/CodeGen/SPIRV/freeze.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/AddUint64.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/dot4add_i8packed.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/dot4add_u8packed.ll
M llvm/test/CodeGen/SPIRV/hlsl-resources/StorageImageDynIdx.ll
M llvm/test/CodeGen/SPIRV/hlsl-resources/StorageImageNonUniformIdx.ll
M llvm/test/CodeGen/SPIRV/image/sampler.ll
M llvm/test/CodeGen/SPIRV/inline/type.ll
M llvm/test/CodeGen/SPIRV/keep-tracked-const.ll
M llvm/test/CodeGen/SPIRV/literals.ll
A llvm/test/CodeGen/SPIRV/llvm-intrinsics/constrained-comparison.ll.bak
M llvm/test/CodeGen/SPIRV/llvm-intrinsics/smul.with.overflow.ll
M llvm/test/CodeGen/SPIRV/llvm-intrinsics/sqrt.ll
M llvm/test/CodeGen/SPIRV/llvm-intrinsics/uadd.with.overflow.ll
M llvm/test/CodeGen/SPIRV/llvm-intrinsics/umul.with.overflow.ll
M llvm/test/CodeGen/SPIRV/llvm-intrinsics/usub.with.overflow.ll
M llvm/test/CodeGen/SPIRV/opaque_pointers.ll
M llvm/test/CodeGen/SPIRV/optimizations/add-check-overflow.ll
M llvm/test/CodeGen/SPIRV/passes/translate-aggregate-uaddo.ll
M llvm/test/CodeGen/SPIRV/pointers/array-skips-gep.ll
A llvm/test/CodeGen/SPIRV/pointers/ptr-eq-types.ll
M llvm/test/CodeGen/SPIRV/pstruct.ll
M llvm/test/CodeGen/SPIRV/scoped_atomicrmw.ll
M llvm/test/CodeGen/SPIRV/sitofp-with-bool.ll
A llvm/test/CodeGen/SPIRV/store-bool.ll
M llvm/test/CodeGen/SPIRV/struct.ll
M llvm/test/CodeGen/SPIRV/transcoding/AtomicCompareExchangeExplicit_cl20.ll
M llvm/test/CodeGen/SPIRV/transcoding/BuildNDRange.ll
M llvm/test/CodeGen/SPIRV/transcoding/OpVectorInsertDynamic_i16.ll
M llvm/test/CodeGen/SPIRV/transcoding/OpenCL/atomic_cmpxchg.ll
M llvm/test/CodeGen/SPIRV/transcoding/OpenCL/atomic_legacy.ll
M llvm/test/CodeGen/SPIRV/transcoding/OpenCL/atomic_work_item_fence.ll
M llvm/test/CodeGen/SPIRV/transcoding/OpenCL/barrier.ll
M llvm/test/CodeGen/SPIRV/transcoding/OpenCL/work_group_barrier.ll
M llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll
M llvm/test/CodeGen/SPIRV/transcoding/group_ops.ll
M llvm/test/CodeGen/SPIRV/transcoding/memcpy-zext.ll
M llvm/test/CodeGen/SPIRV/transcoding/spirv-private-array-initialization.ll
M llvm/test/CodeGen/SPIRV/transcoding/sub_group_ballot.ll
M llvm/test/CodeGen/SPIRV/transcoding/sub_group_clustered_reduce.ll
M llvm/test/CodeGen/SPIRV/transcoding/sub_group_extended_types.ll
M llvm/test/CodeGen/SPIRV/transcoding/sub_group_non_uniform_arithmetic.ll
M llvm/test/CodeGen/SPIRV/transcoding/sub_group_non_uniform_vote.ll
M llvm/test/CodeGen/SPIRV/transcoding/sub_group_shuffle.ll
M llvm/test/CodeGen/SPIRV/transcoding/sub_group_shuffle_relative.ll
M llvm/test/CodeGen/SPIRV/uitofp-with-bool.ll
Log Message:
-----------
[SPIR-V] Rework duplicate tracker and tracking of IR entities and types to improve compile-time performance (#130605)
This PR is to thoroughly rework duplicate tracker implementation and
tracking of IR entities and types. These are legacy parts of the project
resulting in an extremely bloated intermediate representation and
computational delays due to inefficient data flow and structure choices.
Main results of the rework:
1) Improved compile-time performance. The reference binary LLVM IR used
to measure speed gains in
https://github.com/llvm/llvm-project/pull/120415 shows ~x5 speed up also
after this PR. The timing before this PR is ~42s and after this PR it's
~7.5s. In total this PR and the previous overhaul of the module analysis
in https://github.com/llvm/llvm-project/pull/120415 results in ~x25
speed improvement.
```
$ time llc -O0 -mtriple=spirv64v1.6-unknown-unknown _group_barrier_phi.bc -o 1 --filetype=obj
real 0m7.545s
user 0m6.685s
sys 0m0.859s
```
2) Less bloated intermediate representation of internal translation
steps. Elimination of `spv_track_constant` intrinsic usage for scalar
constants, rework of `spv_assign_name`, removal of the gMIR `GET_XXX`
pseudo code and a smaller number of generated `ASSIGN_TYPE` pseudo codes
substantially decrease volume of data generated during translation.
3) Simpler code and easier maintenance. The duplicate tracker
implementation is simplified, as well as other features.
4) Numerous fixes of issues and logical flaws in different passes. The
main achievement is rework of the duplicate tracker itself that had
never guaranteed a correct caching of LLVM IR entities, rarely and
randomly returning stale/incorrect records (like, remove an instruction
from gMIR but still refer to it). Other fixes comprise consistent
generation of OpConstantNull, assigning types to newly created
registers, creation of integer/bool types, and other minor fixes.
5) Numerous fixes of LIT tests: mainly CHECK-DAG to properly reflect
SPIR-V spec guarantees, `{{$}}` at the end of constants to avoid
matching of substrings, and XFAILS for `SPV_INTEL_long_composites` test
cases, because the feature is not completed in full yet and doesn't
generate a requested by the extension sequence of instructions.
6) New test cases are added.
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