Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3353,10 +3353,11 @@ bool SPIRVInstructionSelector::selectGEP(Register ResVReg,
.addUse(GR.getSPIRVTypeID(ResType))
// Object to get a pointer to.
.addUse(I.getOperand(3).getReg());
assert(Opcode == SPIRV::OpPtrAccessChain ||
Opcode == SPIRV::OpInBoundsPtrAccessChain ||
(getImm(I.getOperand(4), MRI) && foldImm(I.getOperand(4), MRI) == 0) &&
"Cannot translate GEP to OpAccessChain. First index must be 0.");
assert(
(Opcode == SPIRV::OpPtrAccessChain ||
Opcode == SPIRV::OpInBoundsPtrAccessChain ||
(getImm(I.getOperand(4), MRI) && foldImm(I.getOperand(4), MRI) == 0)) &&
"Cannot translate GEP to OpAccessChain. First index must be 0.");

// Adding indices.
const unsigned StartingIndex =
Expand Down
Loading