[all-commits] [llvm/llvm-project] 3544d2: [SPIRV] add IR regularization pass

Ilia Diachkov via All-commits all-commits at lists.llvm.org
Thu Sep 15 05:10:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3544d200d982cb6ce9654130751f0e24d2a61a49
      https://github.com/llvm/llvm-project/commit/3544d200d982cb6ce9654130751f0e24d2a61a49
  Author: Ilia Diachkov <ilia.diachkov at gmail.com>
  Date:   2022-09-15 (Thu, 15 Sep 2022)

  Changed paths:
    M llvm/lib/Target/SPIRV/CMakeLists.txt
    M llvm/lib/Target/SPIRV/SPIRV.h
    M llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
    M llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
    M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
    M llvm/lib/Target/SPIRV/SPIRVISelLowering.cpp
    M llvm/lib/Target/SPIRV/SPIRVISelLowering.h
    M llvm/lib/Target/SPIRV/SPIRVInstrFormats.td
    M llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
    M llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
    M llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
    M llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
    A llvm/lib/Target/SPIRV/SPIRVRegularizer.cpp
    M llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp
    M llvm/lib/Target/SPIRV/SPIRVUtils.cpp
    M llvm/lib/Target/SPIRV/SPIRVUtils.h
    A llvm/test/CodeGen/SPIRV/llvm-intrinsics/bswap.ll
    A llvm/test/CodeGen/SPIRV/llvm-intrinsics/memset.ll
    A llvm/test/CodeGen/SPIRV/lshr-constexpr.ll
    A llvm/test/CodeGen/SPIRV/opencl/get_global_id.ll
    A llvm/test/CodeGen/SPIRV/transcoding/OpMin.ll

  Log Message:
  -----------
  [SPIRV] add IR regularization pass

The patch adds the regularization pass that prepare LLVM IR for
the IR translation. It also contains following changes:
- reduce indentation, make getNonParametrizedType, getSamplerType,
getPipeType, getImageType, getSampledImageType static in SPIRVBuiltins,
- rename mayBeOclOrSpirvBuiltin to getOclOrSpirvBuiltinDemangledName,
- move isOpenCLBuiltinType, isSPIRVBuiltinType, isSpecialType from
SPIRVGlobalRegistry.cpp to SPIRVUtils.cpp, renaming isSpecialType to
isSpecialOpaqueType,
- implment getTgtMemIntrinsic() in SPIRVISelLowering,
- add hasSideEffects = 0 in Pseudo (SPIRVInstrFormats.td),
- add legalization rule for G_MEMSET, correct G_BRCOND rule,
- add capability processing for OpBuildNDRange in SPIRVModuleAnalysis,
- don't correct types of registers holding constants and used in
G_ADDRSPACE_CAST (SPIRVPreLegalizer.cpp),
- lower memset/bswap intrinsics to functions in SPIRVPrepareFunctions,
- change TargetLoweringObjectFileELF to SPIRVTargetObjectFile
in SPIRVTargetMachine.cpp,
- correct comments.
5 LIT tests are added to show the improvement.

Differential Revision: https://reviews.llvm.org/D133253

Co-authored-by: Aleksandr Bezzubikov <zuban32s at gmail.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski at outlook.com>
Co-authored-by: Andrey Tretyakov <andrey1.tretyakov at intel.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic at intel.com>




More information about the All-commits mailing list