[PATCH] D129730: [SPIRV] add PrepareFunctions pass and update other passed

Ilia Diachkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 21:28:31 PDT 2022


iliya-diyachkov created this revision.
iliya-diyachkov added reviewers: zuban32, rengolin, MaskRay, arsenm, konrad.trifunovic, mpaszkowski, andreytr.
Herald added subscribers: nlopes, StephenFan, ThomasRaoux, hiraditya, mgorny.
Herald added a project: All.
iliya-diyachkov requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

The patch adds PrepareFunctions pass, which modifies function signatures containing aggregate arguments and/or return value before IR translation. Information about the original signatures is stored in metadata. It is used during call lowering to restore correct SPIRV types of function arguments and return values. This pass also substitutes some llvm intrinsic calls to function calls, generating required functions in the module as the SPIRV translator does.

Also the patch includes the changes in other modules, enabling many SPIRV features that were not very functional without DT patch by Aleksandr <https://reviews.llvm.org/D128471> and were omitted earlier. As a result, many new LIT tests began to pass, 15 of them are also included into the patch, others will be added later.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129730

Files:
  llvm/include/llvm/IR/IntrinsicsSPIRV.td
  llvm/lib/Target/SPIRV/CMakeLists.txt
  llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp
  llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.h
  llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp
  llvm/lib/Target/SPIRV/SPIRV.h
  llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
  llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
  llvm/lib/Target/SPIRV/SPIRVCallLowering.h
  llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
  llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
  llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
  llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp
  llvm/lib/Target/SPIRV/SPIRVInstrInfo.h
  llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
  llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
  llvm/lib/Target/SPIRV/SPIRVMCInstLower.cpp
  llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
  llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h
  llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
  llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
  llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp
  llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp
  llvm/lib/Target/SPIRV/SPIRVUtils.cpp
  llvm/lib/Target/SPIRV/SPIRVUtils.h
  llvm/test/CodeGen/SPIRV/AtomicCompareExchange.ll
  llvm/test/CodeGen/SPIRV/branching/if-non-merging.ll
  llvm/test/CodeGen/SPIRV/constant/global-constants.ll
  llvm/test/CodeGen/SPIRV/constant/local-aggregate-constant.ll
  llvm/test/CodeGen/SPIRV/constant/local-bool-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/instructions/call-complex-function.ll
  llvm/test/CodeGen/SPIRV/instructions/nested-composites.ll
  llvm/test/CodeGen/SPIRV/instructions/scalar-integer-arithmetic.ll
  llvm/test/CodeGen/SPIRV/instructions/select.ll
  llvm/test/CodeGen/SPIRV/instructions/vector-floating-point-arithmetic.ll
  llvm/test/CodeGen/SPIRV/instructions/vector-integer-arithmetic.ll
  llvm/test/CodeGen/SPIRV/llvm-intrinsics/fshl.ll
  llvm/test/CodeGen/SPIRV/metadata-opencl.ll
  llvm/test/CodeGen/SPIRV/opaque_pointers.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129730.444460.patch
Type: text/x-patch
Size: 147195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220714/058f19c5/attachment-0001.bin>


More information about the llvm-commits mailing list