[all-commits] [llvm/llvm-project] 35dfeb: [SPIRV] Enable DCE in instruction selection and up...

Steven Perron via All-commits all-commits at lists.llvm.org
Wed Nov 26 06:52:20 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35dfeb7b4d720f16e9ded25527a0631d63736d78
      https://github.com/llvm/llvm-project/commit/35dfeb7b4d720f16e9ded25527a0631d63736d78
  Author: Steven Perron <stevenperron at google.com>
  Date:   2025-11-26 (Wed, 26 Nov 2025)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    M llvm/test/CodeGen/SPIRV/OpVariable_order.ll
    M llvm/test/CodeGen/SPIRV/SpecConstants/restore-spec-type.ll
    M llvm/test/CodeGen/SPIRV/basic_float_types.ll
    M llvm/test/CodeGen/SPIRV/basic_int_types.ll
    M llvm/test/CodeGen/SPIRV/basic_int_types_spirvdis.ll
    M llvm/test/CodeGen/SPIRV/builtin_intrinsics_32.ll
    M llvm/test/CodeGen/SPIRV/builtin_intrinsics_64.ll
    M llvm/test/CodeGen/SPIRV/builtin_vars-decorate.ll
    M llvm/test/CodeGen/SPIRV/debug-info/debug-type-pointer.ll
    M llvm/test/CodeGen/SPIRV/event-zero-const.ll
    M llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_function_pointers/fun-ptr-addrcast.ll
    M llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_bfloat16/bfloat16.ll
    M llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_float_controls2/decoration.ll
    M llvm/test/CodeGen/SPIRV/extensions/enable-all-extensions-but-one.ll
    M llvm/test/CodeGen/SPIRV/freeze.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/AddUint64.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/abs.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/log10.ll
    M llvm/test/CodeGen/SPIRV/instructions/insertvalue-undef-ptr.ll
    M llvm/test/CodeGen/SPIRV/instructions/select-ptr-load.ll
    R llvm/test/CodeGen/SPIRV/keep-tracked-const.ll
    M llvm/test/CodeGen/SPIRV/llvm-intrinsics/assume.ll
    M llvm/test/CodeGen/SPIRV/llvm-intrinsics/bitreverse_small_type.ll
    M llvm/test/CodeGen/SPIRV/llvm-intrinsics/constrained-arithmetic.ll
    M llvm/test/CodeGen/SPIRV/llvm-intrinsics/lifetime.ll
    M llvm/test/CodeGen/SPIRV/llvm-intrinsics/satur-arith.ll
    M llvm/test/CodeGen/SPIRV/llvm-intrinsics/uadd.with.overflow.ll
    M llvm/test/CodeGen/SPIRV/logical-access-chain.ll
    M llvm/test/CodeGen/SPIRV/logical-struct-access.ll
    M llvm/test/CodeGen/SPIRV/phi-insert-point.ll
    M llvm/test/CodeGen/SPIRV/phi-ptrcast-dominate.ll
    M llvm/test/CodeGen/SPIRV/pointers/bitcast-fix-accesschain.ll
    M llvm/test/CodeGen/SPIRV/pointers/bitcast-fix-load.ll
    M llvm/test/CodeGen/SPIRV/pointers/gep-types-1.ll
    M llvm/test/CodeGen/SPIRV/pointers/getelementptr-addressspace.ll
    M llvm/test/CodeGen/SPIRV/pointers/getelementptr-base-type.ll
    M llvm/test/CodeGen/SPIRV/pointers/getelementptr-bitcast-load.ll
    M llvm/test/CodeGen/SPIRV/pointers/getelementptr-kernel-arg-char.ll
    M llvm/test/CodeGen/SPIRV/pointers/global-addrspacecast.ll
    M llvm/test/CodeGen/SPIRV/pointers/load-addressspace.ll
    M llvm/test/CodeGen/SPIRV/pointers/phi-chain-types.ll
    M llvm/test/CodeGen/SPIRV/pointers/pointer-addrspacecast.ll
    M llvm/test/CodeGen/SPIRV/pointers/ptr-eq-types.ll
    M llvm/test/CodeGen/SPIRV/pointers/resource-vector-load-store.ll
    M llvm/test/CodeGen/SPIRV/pointers/type-deduce-call-no-bitcast.ll
    A llvm/test/CodeGen/SPIRV/remove-dead-type-intrinsics.ll
    M llvm/test/CodeGen/SPIRV/transcoding/OpBitReverse-subbyte.ll
    M llvm/test/CodeGen/SPIRV/transcoding/OpGenericCastToPtr.ll
    M llvm/test/CodeGen/SPIRV/transcoding/OpPtrCastToGeneric.ll
    M llvm/test/CodeGen/SPIRV/transcoding/fcmp.ll
    M llvm/test/CodeGen/SPIRV/transcoding/spirv-event-null.ll
    M llvm/test/CodeGen/SPIRV/uitofp-with-bool.ll

  Log Message:
  -----------
  [SPIRV] Enable DCE in instruction selection and update tests (#168428)

The instruction selection pass for SPIR-V now performs dead code
elimination (DCE).
This change removes unused instructions, leading to more optimized
SPIR-V output.

As a consequence of this, several tests were updated to ensure their
continued
correctness and to prevent previously tested code from being optimized
away.
Specifically:
- Many tests now store computed values into global variables to ensure
they are
  not eliminated by DCE, allowing their code generation to be verified.
- The test `keep-tracked-const.ll` was removed because it no longer
tested
its original intent. The check statements in this test were for
constants
generated when expanding a G_TRUNC instruction, which is now removed by
DCE
  instead of being expanded.
- A new test, `remove-dead-type-intrinsics.ll`, was added to confirm
that dead
  struct types are correctly removed by the compiler.

These updates improve the SPIR-V backends optimization capabilities and
maintain the robustness of the test suite.

---------

Co-authored-by: Nathan Gauër <github at keenuts.net>



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