Skip to content

Commit e94a871

Browse files
Gwen Mittertreinergmittert
authored andcommitted
Improve TypeLayout IRGen for Fixed Structs
If the Aligned Group is fixed sized and alignment, rather than doing an alignment computation at runtime, we compute the offset for each field and emit a GEP.
1 parent b6cff0b commit e94a871

File tree

4 files changed

+500
-111
lines changed

4 files changed

+500
-111
lines changed

lib/IRGen/GenStruct.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ namespace {
708708
return fields[0];
709709
}
710710

711-
return IGM.typeLayoutCache.getOrCreateAlignedGroupEntry(fields, 1, false);
711+
return IGM.typeLayoutCache.getOrCreateAlignedGroupEntry(fields, 1);
712712
}
713713

714714
// We have an indirect schema.

lib/IRGen/GenTuple.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,9 @@ namespace {
329329
return fields[0];
330330
}
331331

332-
return IGM.typeLayoutCache.getOrCreateAlignedGroupEntry(fields, 1, false);
332+
return IGM.typeLayoutCache.getOrCreateAlignedGroupEntry(fields, 1);
333333
}
334334

335-
336335
llvm::Value *getEnumTagSinglePayload(IRGenFunction &IGF,
337336
llvm::Value *numEmptyCases,
338337
Address structAddr,

0 commit comments

Comments
 (0)