[llvm] [SPIRV] Add OpAccessChain instruction support (PR #66253)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 07:59:29 PDT 2023


================
@@ -1299,18 +1299,28 @@ bool SPIRVInstructionSelector::selectExtractElt(Register ResVReg,
 bool SPIRVInstructionSelector::selectGEP(Register ResVReg,
                                          const SPIRVType *ResType,
                                          MachineInstr &I) const {
-  // In general we should also support OpAccessChain instrs here (i.e. not
-  // PtrAccessChain) but SPIRV-LLVM Translator doesn't emit them at all and so
-  // do we to stay compliant with its test and more importantly consumers.
-  unsigned Opcode = I.getOperand(2).getImm() ? SPIRV::OpInBoundsPtrAccessChain
-                                             : SPIRV::OpPtrAccessChain;
+  const bool isGEPInBounds = I.getOperand(2).getImm();
----------------
Keenuts wrote:

Ah, that timing is a bit unfortunate 🙃 Sent a PR.

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


More information about the llvm-commits mailing list