[all-commits] [llvm/llvm-project] c01b5b: [SPIRV] Add OpAccessChain instruction support (#66...

Nathan Gauër via All-commits all-commits at lists.llvm.org
Tue Sep 26 07:33:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c01b5bbba3df64086fa456a53a06ec81495698af
      https://github.com/llvm/llvm-project/commit/c01b5bbba3df64086fa456a53a06ec81495698af
  Author: Nathan Gauër <brioche at google.com>
  Date:   2023-09-26 (Tue, 26 Sep 2023)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    A llvm/test/CodeGen/SPIRV/logical-access-chain.ll
    A llvm/test/CodeGen/SPIRV/logical-struct-access.ll

  Log Message:
  -----------
  [SPIRV] Add OpAccessChain instruction support (#66253)

This commit adds 2 new instructions in the selector:
 - OpAccessChain
 - OpInBoundsAccessChain.

The choice between the two relies on the `inbounds` marker.

Those instruction are not used for OpenCL, to maintain the same
behavior as previously. They are only added when building for logical
SPIR-V, as it doesn't support the pointer equivalent.

Because logical SPIR-V doesn't support pointer cast either, the
assign_ptr_type intrinsic need to be generated so OpAccessChain gets
lowered with the correct pointer type, instead of i8*.

Fixes #66107

---------

Signed-off-by: Nathan Gauër <brioche at google.com>




More information about the All-commits mailing list