File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -263,8 +263,13 @@ bool DXILFlattenArraysVisitor::visitGetElementPtrInst(GetElementPtrInst &GEP) {
263
263
// merge the byte offsets. Otherwise, this GEP is itself the root of a GEP
264
264
// chain and we need to deterine the root array type
265
265
if (auto *PtrOpGEP = dyn_cast<GEPOperator>(PtrOperand)) {
266
- assert (GEPChainInfoMap.contains (PtrOpGEP) &&
267
- " Expected parent GEP to be visited before this GEP" );
266
+
267
+ // If the parent GEP was not processed, then we do not want to process its
268
+ // descendants. This can happen if the GEP chain is for an unsupported type
269
+ // such as structs -- we do not flatten structs.
270
+ if (!GEPChainInfoMap.contains (PtrOpGEP))
271
+ return false ;
272
+
268
273
GEPInfo &PGEPInfo = GEPChainInfoMap[PtrOpGEP];
269
274
Info.RootFlattenedArrayType = PGEPInfo.RootFlattenedArrayType ;
270
275
Info.RootPointerOperand = PGEPInfo.RootPointerOperand ;
You can’t perform that action at this time.
0 commit comments