diff options
Diffstat (limited to 'llvm/lib/Transforms/IPO/HotColdSplitting.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp index 1d804ccb767..d3e086e972a 100644 --- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp @@ -360,6 +360,13 @@ HotColdSplitting::extractColdRegion(const SmallVectorImpl<BasicBlock *> &Region, CS.setCallingConv(CallingConv::Cold); } CI->setIsNoInline(); + + // Try to make the outlined code as small as possible on the assumption + // that it's cold. + assert(!OutF->hasFnAttribute(Attribute::OptimizeNone) && + "An outlined function should never be marked optnone"); + OutF->addFnAttr(Attribute::MinSize); + LLVM_DEBUG(llvm::dbgs() << "Outlined Region: " << *OutF); ORE.emit([&]() { return OptimizationRemark(DEBUG_TYPE, "HotColdSplit", |