Skip to content

Commit 72d13a3

Browse files
committed
Don't emit an outlined call to a noop function
1 parent 0dd8974 commit 72d13a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/IRGen/Outlining.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ llvm::Constant *IRGenModule::getOrCreateOutlinedCopyAddrHelperFunction(
329329

330330
void TypeInfo::callOutlinedDestroy(IRGenFunction &IGF,
331331
Address addr, SILType T) const {
332+
// Short-cut destruction of trivial values.
333+
if (IGF.IGM.getTypeLowering(T).isTrivial())
334+
return;
335+
332336
if (!IGF.IGM.getOptions().UseTypeLayoutValueHandling) {
333337
OutliningMetadataCollector collector(IGF);
334338
if (T.hasArchetype()) {

0 commit comments

Comments
 (0)