[PATCH] D156424: [SPIRV] Add SPIR-V logical triple to llc

Nathan Gauër via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 06:06:06 PDT 2023


Keenuts created this revision.
Herald added subscribers: Anastasia, pmatos, ThomasRaoux, hiraditya.
Herald added a project: All.
Keenuts updated this revision to Diff 544729.
Keenuts added a comment.
iliya-diyachkov retitled this revision from "[SPIRV-V] Add SPIR-V logical triple to llc" to "[SPIRV] Add SPIR-V logical triple to llc".
iliya-diyachkov added reviewers: iliya-diyachkov, mpaszkowski, zuban32, konrad.trifunovic, andreytr.
Keenuts updated this revision to Diff 549363.
Keenuts published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

git process crashed, no changes I suppose.


Keenuts added a comment.

- [SPIRV-V] Add SPIR-V logical triple to llc
- fixup! [SPIRV-V] Add SPIR-V logical triple to llc
- fixup! [SPIRV-V] Add SPIR-V logical triple to llc
- fixup! [SPIRV-V] Add SPIR-V logical triple to llc

Removed the Logical SPIRV data layout string. We might want to
stick with SPIRV32 data layout while this is fuzzy.

Removed changes to the HLSL frontend, and adds logic to check
the HLSL attributes in the backend.
I believe this is better, as we can emit LLVM from HLSL without having
to know the target backend.
Note: we might want to unify attributes later.


This commits adds the minimal required bits to build a logical SPIR-V
compute shader using LLC.

- Skip OpenCL-only capabilities & extensions for Logical SPIR-V.
- Generate required metadata for entrypoints from HLSL frontend.
- Fix execution mode to GLCompute in logical.

The main issue is the lack of "vulkan" bit in the triple.
This might need to be added as a vendor?
Because as-is, SPIRV32/64 assumes OpenCL, and then, SPIRV assumes
Vulkan. This is ok-ish today, but not correct.

Depends on D155978 <https://reviews.llvm.org/D155978>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156424

Files:
  llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCTargetDesc.cpp
  llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
  llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
  llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
  llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h
  llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp
  llvm/lib/Target/SPIRV/SPIRVSubtarget.h
  llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp
  llvm/lib/Target/SPIRV/TargetInfo/SPIRVTargetInfo.cpp
  llvm/lib/Target/SPIRV/TargetInfo/SPIRVTargetInfo.h
  llvm/test/CodeGen/SPIRV/ExecutionMode_GLCompute.ll
  llvm/test/CodeGen/SPIRV/capability-Shader.ll
  llvm/test/CodeGen/SPIRV/empty-logical.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156424.549363.patch
Type: text/x-patch
Size: 16825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230811/37557ff2/attachment.bin>


More information about the llvm-commits mailing list