News: 0001469465

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

AMD Lands Support For Vendor Flavored SPIR-V Within LLVM

([LLVM] 108 Minutes Ago AMDGCN Flavored SPIR-V)


SPIR-V used by the likes of OpenGL, OpenCL, and Vulkan is a common intermediate representation (IR) / intermediate language for consumption by device drivers. With code now merged into LLVM, AMD has introduced the notion of vendor "flavored" SPIR-V for containing extra information pertinent to the GPU device/driver being targeted.

Alex Voicu of AMD's ROCm team has introduced to LLVM the notion of vendor-flavored SPIR-V and goes through in implementing an AMDGCN-flavored SPIR-V to be consumed by the LLVM AMDGPU compiler back-end. This vendor flavored SPIR-V is intentionally device/back-end specific and knowingly "forfeiting absolute genericity to obtain greater expressiveness for target features."

The merge commit message clarifies:

"This is still SPIRV, albeit relaxed in terms of preconditions & constrained in terms of postconditions, and only guaranteed to be usable on AMDGCN targets (it is still possible to obtain pristine portable SPIRV through usage of the flavoured target, though)."

With the AMDGCN flavored SPIR-V, inline AMDGCN Assembly is supported in conjunction with the SPV_INTEL_inline_assembly extension, AMDGCN target-specific built-ins are supported, and the SPIR-V feature set better matches the particular AMDGCN target. Further patches around this vendor-flavored SPIR-V are being worked on. It will be interesting to see how AMD ultimately intends to utilize this flavored SPIR-V and the net benefits in the end for better performance and features in not being limited to the default SPIR-V restrictions.

More details via [1]this LLVM pull request that was merged today into the LLVM 19 codebase.



[1] https://github.com/llvm/llvm-project/pull/89796



phoronix

A young man wrote to Mozart and said:

Q: "Herr Mozart, I am thinking of writing symphonies. Can you give me any
suggestions as to how to get started?"
A: "A symphony is a very complex musical form, perhaps you should begin with
some simple lieder and work your way up to a symphony."
Q: "But Herr Mozart, you were writing symphonies when you were 8 years old."
A: "But I never asked anybody how."