[PATCH] D156049: [SPIR-V] Remove -opaque-pointers=0 from LITs, fixes for opaque pointers support

Michal Paszkowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 23 02:33:43 PDT 2023


mpaszkowski created this revision.
mpaszkowski added reviewers: iliya-diyachkov, konrad.trifunovic, andreytr, zuban32.
Herald added subscribers: wenlei, ThomasRaoux, hiraditya, Anastasia.
Herald added a project: All.
mpaszkowski requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, wangpc, jplehr, sstefan1.
Herald added a project: LLVM.

This patch removes the -opaque-pointers=0 flag from all* the remaining tests. Some significant changes to the SPIRVGlobalRegistry, SPIRVDupliactesTracker, Intrinsics were necessary -- most notably the introduction of spv_assign_ptr_type intrinsic for tracking the underlying type of pointers.

*The following relevant tests are removed by this patch (they still require additional adjustments and fixes in the backend, will reland in subsequent patches):

- CodeGen/SPIRV/EnqueueEmptyKernel.ll
- CodeGen/SPIRV/OpenCL/basic/vstore_private.ll
- CodeGen/SPIRV/OpenCL/execute_block.ll
- CodeGen/SPIRV/half_no_extension.ll
- CodeGen/SPIRV/transcoding/BuildNDRange_2.ll
- CodeGen/SPIRV/transcoding/block_w_struct_return.ll
- CodeGen/SPIRV/transcoding/enqueue_kernel.ll
- CodeGen/SPIRV/transcoding/global_block.ll

In the upcoming week I will do best to recover the CTS testing pipeline. This requires generating of opaque IR (opaque pointers, target extension type, ...) from Intel Graphics Compiler based on LLVM 14. I expect the CTS pass rate to drop significantly.

In the meantime, I am preparing a patch dropping support for typed pointers (removing references to APIs), OpenCL/SPIR-V builtin opaque types, and any other "dead" parts of code. This patch will also partially tackle the issues discovered in the LITs from the list above and failing CTS tests.

There are still known issues which might be now easier to work on since we no longer need to support typed pointers:

- issues with lowering enqueue, ndrange builtins
- issues with lowering some structs in opaque pointer mode
- duplicate getOrCreateSPIRVPointerType methods in SPIRVGlobalRegistry
- opaque pointer handling in SPIRVDuplicatesTracker may require major redesign

I hope to discuss some of these issues during the SPIR-V Backend WG sync on Thursday.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156049

Files:
  llvm/include/llvm/IR/IntrinsicsSPIRV.td
  llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
  llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
  llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
  llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
  llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
  llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
  llvm/test/CodeGen/SPIRV/EnqueueEmptyKernel.ll
  llvm/test/CodeGen/SPIRV/OpenCL/get_global_id.ll
  llvm/test/CodeGen/SPIRV/OpenCL/get_global_offset.ll
  llvm/test/CodeGen/SPIRV/OpenCL/metadata/fp_contractions_metadata.ll
  llvm/test/CodeGen/SPIRV/OpenCL/metadata/kernel_arg_type_function_metadata.ll
  llvm/test/CodeGen/SPIRV/OpenCL/metadata/kernel_arg_type_module_metadata.ll
  llvm/test/CodeGen/SPIRV/OpenCL/metadata/no_fp_contractions_metadata.ll
  llvm/test/CodeGen/SPIRV/OpenCL/metadata/opencl_version_metadata.ll
  llvm/test/CodeGen/SPIRV/OpenCL/progvar_prog_scope_init.ll
  llvm/test/CodeGen/SPIRV/OpenCL/progvar_prog_scope_uninit.ll
  llvm/test/CodeGen/SPIRV/OpenCL/wait_group_events.ll
  llvm/test/CodeGen/SPIRV/SampledImageRetType.ll
  llvm/test/CodeGen/SPIRV/atomicrmw.ll
  llvm/test/CodeGen/SPIRV/capabilities/capability-Float64-ImageBasic.ll
  llvm/test/CodeGen/SPIRV/capabilities/capability-Int64Atomics-store.ll
  llvm/test/CodeGen/SPIRV/capabilities/capability-Int64Atomics.ll
  llvm/test/CodeGen/SPIRV/capabilities/capability-integers.ll
  llvm/test/CodeGen/SPIRV/capabilities/capability-kernel.ll
  llvm/test/CodeGen/SPIRV/capabilities/no_capability_shader.ll
  llvm/test/CodeGen/SPIRV/capability-Int64Atomics-store.ll
  llvm/test/CodeGen/SPIRV/capability-Int64Atomics.ll
  llvm/test/CodeGen/SPIRV/capability-integers.ll
  llvm/test/CodeGen/SPIRV/capability-kernel.ll
  llvm/test/CodeGen/SPIRV/constant/global-constants.ll
  llvm/test/CodeGen/SPIRV/constant/local-aggregate-constant.ll
  llvm/test/CodeGen/SPIRV/constant/local-arbitrary-width-integers-constants-type-promotion.ll
  llvm/test/CodeGen/SPIRV/constant/local-bool-constants.ll
  llvm/test/CodeGen/SPIRV/constant/local-float-point-constants.ll
  llvm/test/CodeGen/SPIRV/constant/local-integers-constants.ll
  llvm/test/CodeGen/SPIRV/constant/local-null-constants.ll
  llvm/test/CodeGen/SPIRV/constant/local-vector-matrix-constants.ll
  llvm/test/CodeGen/SPIRV/constants/global-constants.ll
  llvm/test/CodeGen/SPIRV/constants/local-aggregate-constant.ll
  llvm/test/CodeGen/SPIRV/constants/local-arbitrary-width-integers-constants-type-promotion.ll
  llvm/test/CodeGen/SPIRV/constants/local-bool-constants.ll
  llvm/test/CodeGen/SPIRV/constants/local-float-point-constants.ll
  llvm/test/CodeGen/SPIRV/constants/local-integers-constants.ll
  llvm/test/CodeGen/SPIRV/constants/local-null-constants.ll
  llvm/test/CodeGen/SPIRV/constants/local-vector-matrix-constants.ll
  llvm/test/CodeGen/SPIRV/event_no_group_cap.ll
  llvm/test/CodeGen/SPIRV/function/alloca-load-store.ll
  llvm/test/CodeGen/SPIRV/function/mangled-function.ll
  llvm/test/CodeGen/SPIRV/half_extension.ll
  llvm/test/CodeGen/SPIRV/half_no_extension.ll
  llvm/test/CodeGen/SPIRV/image-unoptimized.ll
  llvm/test/CodeGen/SPIRV/image.ll
  llvm/test/CodeGen/SPIRV/image_decl_func_arg.ll
  llvm/test/CodeGen/SPIRV/image_dim.ll
  llvm/test/CodeGen/SPIRV/image_store.ll
  llvm/test/CodeGen/SPIRV/link-attribute.ll
  llvm/test/CodeGen/SPIRV/linked-list.ll
  llvm/test/CodeGen/SPIRV/literal-struct.ll
  llvm/test/CodeGen/SPIRV/llvm-intrinsics/memset.ll
  llvm/test/CodeGen/SPIRV/llvm-intrinsics/sqrt.ll
  llvm/test/CodeGen/SPIRV/llvm-intrinsics/umul-with-overflow.ll
  llvm/test/CodeGen/SPIRV/llvm-intrinsics/umul.with.overflow.ll
  llvm/test/CodeGen/SPIRV/mangled_function.ll
  llvm/test/CodeGen/SPIRV/no_capability_shader.ll
  llvm/test/CodeGen/SPIRV/opaque_pointers.ll
  llvm/test/CodeGen/SPIRV/opencl.queue_t.ll
  llvm/test/CodeGen/SPIRV/opencl/basic/get_global_offset.ll
  llvm/test/CodeGen/SPIRV/opencl/basic/progvar_prog_scope_init.ll
  llvm/test/CodeGen/SPIRV/opencl/basic/progvar_prog_scope_uninit.ll
  llvm/test/CodeGen/SPIRV/opencl/basic/vstore_private.ll
  llvm/test/CodeGen/SPIRV/opencl/device_execution/execute_block.ll
  llvm/test/CodeGen/SPIRV/opencl/get_global_id.ll
  llvm/test/CodeGen/SPIRV/opencl/image.ll
  llvm/test/CodeGen/SPIRV/opencl/metadata/fp_contractions_metadata.ll
  llvm/test/CodeGen/SPIRV/opencl/metadata/kernel_arg_type_function_metadata.ll
  llvm/test/CodeGen/SPIRV/opencl/metadata/kernel_arg_type_module_metadata.ll
  llvm/test/CodeGen/SPIRV/opencl/metadata/no_fp_contractions_metadata.ll
  llvm/test/CodeGen/SPIRV/opencl/metadata/opencl_version_metadata.ll
  llvm/test/CodeGen/SPIRV/pstruct.ll
  llvm/test/CodeGen/SPIRV/read_image.ll
  llvm/test/CodeGen/SPIRV/struct.ll
  llvm/test/CodeGen/SPIRV/transcoding/BuildNDRange_2.ll
  llvm/test/CodeGen/SPIRV/transcoding/OpConstantSampler.ll
  llvm/test/CodeGen/SPIRV/transcoding/OpImageQuerySize.ll
  llvm/test/CodeGen/SPIRV/transcoding/OpImageReadMS.ll
  llvm/test/CodeGen/SPIRV/transcoding/OpImageSampleExplicitLod.ll
  llvm/test/CodeGen/SPIRV/transcoding/OpImageWrite.ll
  llvm/test/CodeGen/SPIRV/transcoding/OpenCL/atomic_cmpxchg.ll
  llvm/test/CodeGen/SPIRV/transcoding/OpenCL/atomic_legacy.ll
  llvm/test/CodeGen/SPIRV/transcoding/SampledImage.ll
  llvm/test/CodeGen/SPIRV/transcoding/block_w_struct_return.ll
  llvm/test/CodeGen/SPIRV/transcoding/check_ro_qualifier.ll
  llvm/test/CodeGen/SPIRV/transcoding/cl-types.ll
  llvm/test/CodeGen/SPIRV/transcoding/clk_event_t.ll
  llvm/test/CodeGen/SPIRV/transcoding/enqueue_kernel.ll
  llvm/test/CodeGen/SPIRV/transcoding/extract_insert_value.ll
  llvm/test/CodeGen/SPIRV/transcoding/get_image_num_mip_levels.ll
  llvm/test/CodeGen/SPIRV/transcoding/global_block.ll
  llvm/test/CodeGen/SPIRV/transcoding/image_get_size_with_access_qualifiers.ll
  llvm/test/CodeGen/SPIRV/transcoding/image_with_access_qualifiers.ll
  llvm/test/CodeGen/SPIRV/transcoding/optional-core-features-multiple.ll
  llvm/test/CodeGen/SPIRV/transcoding/spec_const.ll
  llvm/test/CodeGen/SPIRV/transcoding/spirv-private-array-initialization.ll
  llvm/test/CodeGen/SPIRV/types/device_event.ll
  llvm/test/CodeGen/SPIRV/types/image-access-qualifier.ll
  llvm/test/CodeGen/SPIRV/types/image-function-argument.ll
  llvm/test/CodeGen/SPIRV/types/image-query-dim-array-size.ll
  llvm/test/CodeGen/SPIRV/types/image-query-mip-levels.ll
  llvm/test/CodeGen/SPIRV/types/image-query-size-with-access-qualifier.ll
  llvm/test/CodeGen/SPIRV/types/image-query-size.ll
  llvm/test/CodeGen/SPIRV/types/image-read-ms.ll
  llvm/test/CodeGen/SPIRV/types/image-read.ll
  llvm/test/CodeGen/SPIRV/types/image-sample-explicit-level-of-details.ll
  llvm/test/CodeGen/SPIRV/types/image-sampled.ll
  llvm/test/CodeGen/SPIRV/types/image-sampled2.ll
  llvm/test/CodeGen/SPIRV/types/image-unoptimized.ll
  llvm/test/CodeGen/SPIRV/types/image-various-dimensions-access-qualifiers.ll
  llvm/test/CodeGen/SPIRV/types/image-write.ll
  llvm/test/CodeGen/SPIRV/types/image.ll
  llvm/test/CodeGen/SPIRV/types/image1d.ll
  llvm/test/CodeGen/SPIRV/types/pipe-sampler-image.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156049.543264.patch
Type: text/x-patch
Size: 236446 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230723/9af7c2c4/attachment-0001.bin>


More information about the llvm-commits mailing list