[llvm] [SPIRV][HLSL] Handle arrays of resources (PR #111564)

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 10:54:12 PDT 2024


================
@@ -967,11 +1117,16 @@ void addInstrRequirements(const MachineInstr &MI,
   case SPIRV::OpConstantSampler:
     Reqs.addCapability(SPIRV::Capability::LiteralSampler);
     break;
+  case SPIRV::OpAccessChain:
----------------
VyacheslavLevytskyy wrote:

It's valid and makes sense now because you insert only `OpAccessChain` above in the code, so now you refer just to this single opcode `OpAccessChain`. My question is however, is it possible to produce a more general code in this place and refer to more than a single instruction `OpAccessChain`, meaning other instructions which have the same semantics (OpInBoundsAccessChain?..). Would it produce a better and more flexible piece of code, ready to any relevant changes of the Backend in future? I'd like to avoid a partial implementation when the SPIRV spec is satisfied in 50% -- for example, just for 1 of 2 possible opcodes satisfies the spec requirement wrt. required capabilities.

https://github.com/llvm/llvm-project/pull/111564


More information about the llvm-commits mailing list