[PATCH] D72256: [mlir][spirv] Properly support SPIR-V conversion target

Lei Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 05:38:10 PST 2020


antiagainst created this revision.
antiagainst added reviewers: mravishankar, denis13.
Herald added subscribers: llvm-commits, lucyrfox, mgester, arpith-jacob, csigg, nicolasvasilache, shauheen, burmako, jpienaar, rriddle, mehdi_amini, jfb, hiraditya.
Herald added a project: LLVM.

This commit defines a new SPIR-V dialect attribute for specifying
a SPIR-V target environment. It is a dictionary attribute containing
the SPIR-V version, supported extension list, and allowed capability
list. A SPIRVConversionTarget subclass is created to take in the
target environment and sets proper dynmaically legal ops by querying
the op availability interface of SPIR-V ops to make sure they are
available in the specified target environment. All existing conversions
targeting SPIR-V is changed to use this SPIRVConversionTarget, but
just with the default target environment: SPIR-V 1.0 with Shader
capability and no extra extensions. Allowing specifying the target
environment via input IR is future work.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72256

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/X86/uitofp.ll
  mlir/docs/Dialects/SPIR-V.md
  mlir/include/mlir/Dialect/SPIRV/SPIRVLowering.h
  mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
  mlir/include/mlir/Dialect/SPIRV/TargetAndABI.td
  mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
  mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
  mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
  mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
  mlir/lib/Dialect/SPIRV/TargetAndABI.cpp
  mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
  mlir/test/Dialect/SPIRV/TestAvailability.cpp
  mlir/test/Dialect/SPIRV/target-and-abi.mlir
  mlir/test/Dialect/SPIRV/target-env.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72256.236335.patch
Type: text/x-patch
Size: 48129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200106/4697e9cb/attachment.bin>


More information about the llvm-commits mailing list