[all-commits] [llvm/llvm-project] dbd00a: [SPIRV] Improve type inference of operand presente...

Vyacheslav Levytskyy via All-commits all-commits at lists.llvm.org
Wed Jul 10 22:16:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dbd00a5968d6c823d686714c91f2b4fcfd03797a
      https://github.com/llvm/llvm-project/commit/dbd00a5968d6c823d686714c91f2b4fcfd03797a
  Author: Vyacheslav Levytskyy <vyacheslav.levytskyy at intel.com>
  Date:   2024-07-11 (Thu, 11 Jul 2024)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
    M llvm/lib/Target/SPIRV/SPIRVBuiltins.h
    M llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
    M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
    M llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
    M llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
    M llvm/lib/Target/SPIRV/SPIRVUtils.h
    A llvm/test/CodeGen/SPIRV/SpecConstants/restore-spec-type.ll
    A llvm/test/CodeGen/SPIRV/instructions/atomic-ptr.ll
    M llvm/test/CodeGen/SPIRV/instructions/atomic.ll
    M llvm/test/CodeGen/SPIRV/instructions/atomic_acqrel.ll
    M llvm/test/CodeGen/SPIRV/instructions/atomic_seq.ll
    A llvm/test/CodeGen/SPIRV/pointers/complex.ll
    M llvm/test/CodeGen/SPIRV/pointers/type-deduce-by-call-chain.ll
    A llvm/test/CodeGen/SPIRV/pointers/type-deduce-sycl-stub.ll
    M llvm/test/CodeGen/SPIRV/transcoding/OpGenericCastToPtr.ll
    M llvm/test/CodeGen/SPIRV/transcoding/OpGroupAsyncCopy-strided.ll
    M llvm/test/CodeGen/SPIRV/transcoding/spirv-event-null.ll

  Log Message:
  -----------
  [SPIRV] Improve type inference of operand presented by opaque pointers and aggregate types (#98035)

This PR improves type inference of operand presented by opaque pointers
and aggregate types:
* tries to restore original function return type for aggregate types so
that it's possible to deduce a correct type during emit-intrinsics step
(see llvm/test/CodeGen/SPIRV/SpecConstants/restore-spec-type.ll for the
reproducer of the previously existed issue when spirv-val found a
mismatch between object and ptr types in OpStore due to the incorrect
aggregate types tracing),
* explores untyped pointer operands of store to deduce correct pointee
types,
* creates an extension type to track pointee types from emit-intrinsics
step and further instead of direct and naive usage of TypePointerType
that led previously to crashes due to ban of creation of Value of
TypePointerType type,
* tracks instructions with uncomplete type information and tries to
improve their type info after pass calculated types for all machine
functions (it doesn't traverse a code but rather checks only those
instructions which were tracked as uncompleted),
* address more cases of removing unnecessary bitcasts (see, for example,
changes in test/CodeGen/SPIRV/transcoding/OpGenericCastToPtr.ll where
`CHECK-SPIRV-NEXT` in LIT checks show absence of unneeded bitcasts and
unmangled/mangled versions have proper typing now with equivalent type
info),
* address more cases of well known types or relations between types
within instructions (see, for example, atomic*.ll test cases and
Event-related test cases for improved SPIR-V code generated by the
Backend),
* fix the issue of removing unneeded ptrcast instructions in
pre-legalizer pass that led to creation of new assign-type instructions
with the same argument as source in ptrcast and caused errors in type
inference (the reproducer `complex.ll` test case is added to the PR).



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