[llvm] [Extractor] Use function return for the one and only output (PR #191824)
Shimin Cui via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 10:25:19 PDT 2026
================
@@ -147,13 +154,16 @@ class LLVM_ABI CodeExtractor {
/// which case it will be placed in the entry block of the function from which
/// the code is being extracted. If ArgsInZeroAddressSpace param is set to
/// true, then the aggregate param pointer of the outlined function is
- /// declared in zero address space.
+ /// declared in zero address space. If VoidReturnWithSingleOutput is set to
+ /// true, then the return type of the outlined function is set void even if
+ /// there is only one output.
CodeExtractor(ArrayRef<BasicBlock *> BBs, DominatorTree *DT = nullptr,
bool AggregateArgs = false, BlockFrequencyInfo *BFI = nullptr,
BranchProbabilityInfo *BPI = nullptr,
AssumptionCache *AC = nullptr, bool AllowVarArgs = false,
bool AllowAlloca = false, BasicBlock *AllocationBlock = nullptr,
- std::string Suffix = "", bool ArgsInZeroAddressSpace = false);
+ std::string Suffix = "", bool ArgsInZeroAddressSpace = false,
+ bool VoidReturnWithSingleOutput = false);
----------------
scui-ibm wrote:
Yes, Thanks for the suggestion.
I modified HotColdSplitting and PartialInlinling to use the new code. If you prefer not to change it in this PR, please comment. Thanks
https://github.com/llvm/llvm-project/pull/191824
More information about the llvm-commits
mailing list