[all-commits] [llvm/llvm-project] b1703a: [SPIRV] Change how to detect OpenCL/Vulkan Env and...

Marcos Maronas via All-commits all-commits at lists.llvm.org
Tue Jun 3 06:50:45 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b1703ad38d5bbdb5ede49fb06dc7d63582359b30
      https://github.com/llvm/llvm-project/commit/b1703ad38d5bbdb5ede49fb06dc7d63582359b30
  Author: Marcos Maronas <marcos.maronas at intel.com>
  Date:   2025-06-03 (Tue, 03 Jun 2025)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
    M llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
    M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    M llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
    M llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
    M llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp
    M llvm/lib/Target/SPIRV/SPIRVSubtarget.h
    M llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp
    M llvm/lib/Target/SPIRV/SPIRVTargetTransformInfo.h
    M llvm/test/CodeGen/SPIRV/OpVariable_order.ll
    M llvm/test/CodeGen/SPIRV/empty-logical.ll
    M llvm/test/CodeGen/SPIRV/empty-module.ll
    M llvm/test/CodeGen/SPIRV/global-var-name-align.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/AddUint64.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/abs.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/acos.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/all.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/any.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/asin.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/atan.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/atan2.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/ceil.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/clamp.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/cos.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/cosh.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/countbits.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/cross.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/degrees.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/discard.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/distance.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/dot4add_i8packed.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/dot4add_u8packed.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/exp.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/exp2.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/faceforward.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/firstbithigh.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/firstbitlow.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/floor.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/fmad.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/fmax.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/fmin.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/frac.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/group_memory_barrier_with_group_sync.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/length.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/lerp.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/log.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/log10.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/log2.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/normalize.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/pow.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/radians.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reflect.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/reversebits.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/round.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/rsqrt.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/saturate.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/sin.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/sinh.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/smax.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/smin.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/sqrt.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/step.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/tan.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/tanh.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/trunc.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/umax.ll
    M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/umin.ll
    M llvm/test/CodeGen/SPIRV/inline/type.coop-matrix.ll
    M llvm/test/CodeGen/SPIRV/inline/type.ll
    M llvm/test/CodeGen/SPIRV/inline/type.undef.ll
    M llvm/test/CodeGen/SPIRV/structurizer/HLSLControlFlowHint.ll

  Log Message:
  -----------
  [SPIRV] Change how to detect OpenCL/Vulkan Env and update tests accordingly. (#129689)

A new test added for spirv-friendly builtins for
SPV_KHR_bit_instructions unveiled that current mechanism to detect
whether SPIRV Backend is in OpenCL environment or Vulkan environment was
not good enough. This PR updates how to detect the environment and all
the tests accordingly.

*UPDATE*: the new approach is having a new member in `SPIRVSubtarget` to
represent the environment. It can be either OpenCL, Kernel or Unknown.
If the triple is explicit, we can directly set it at the creation of the
`SPIRVSubtarget`, otherwise we just leave it unknown until we find other
information that can help us set the environment. For now, the only
other information we use to set the environment is `hlsl.shader`
attribute at `SPIRV::ExecutionModel::ExecutionModel
getExecutionModel(const SPIRVSubtarget &STI, const Function &F)`. Going
forward we should consider also specific instructions that are
Kernel-exclusive or Shader-exclusive.

---------

Co-authored-by: marcos.maronas <mmaronas at smtp.igk.intel.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list