Skip to content

Commit 06a2570

Browse files
committed
Address nits
1 parent 4da11cf commit 06a2570

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

llvm/include/llvm/Transforms/Utils/CodeExtractor.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ class CodeExtractorAnalysisCache {
9898
BranchProbabilityInfo *BPI;
9999
AssumptionCache *AC;
100100

101-
// A block outside of the extraction set where any intermediate
102-
// allocations will be placed inside. If this is null, allocations
103-
// will be placed in the entry block of the function.
101+
/// A block outside of the extraction set where any intermediate
102+
/// allocations will be placed inside. If this is null, allocations
103+
/// will be placed in the entry block of the function.
104104
BasicBlock *AllocationBlock;
105105

106-
// If true, varargs functions can be extracted.
106+
/// If true, varargs functions can be extracted.
107107
bool AllowVarArgs;
108108

109-
// Bits of intermediate state computed at various phases of extraction.
109+
/// Bits of intermediate state computed at various phases of extraction.
110110
SetVector<BasicBlock *> Blocks;
111111

112112
/// Lists of blocks that are branched from the code region to be extracted,
@@ -128,32 +128,32 @@ class CodeExtractorAnalysisCache {
128128
/// returns 1, etc.
129129
SmallVector<BasicBlock *> ExtractedFuncRetVals;
130130

131-
// Suffix to use when creating extracted function (appended to the original
132-
// function name + "."). If empty, the default is to use the entry block
133-
// label, if non-empty, otherwise "extracted".
131+
/// Suffix to use when creating extracted function (appended to the original
132+
/// function name + "."). If empty, the default is to use the entry block
133+
/// label, if non-empty, otherwise "extracted".
134134
std::string Suffix;
135135

136-
// If true, the outlined function has aggregate argument in zero address
137-
// space.
136+
/// If true, the outlined function has aggregate argument in zero address
137+
/// space.
138138
bool ArgsInZeroAddressSpace;
139139

140-
// If set, this callback will be used to allocate the arguments in the
141-
// caller before passing it to the outlined function holding the extracted
142-
// piece of code.
140+
/// If set, this callback will be used to allocate the arguments in the
141+
/// caller before passing it to the outlined function holding the extracted
142+
/// piece of code.
143143
CustomArgAllocatorCBTy *CustomArgAllocatorCB;
144144

145-
// A block outside of the extraction set where previously introduced
146-
// intermediate allocations can be deallocated. This is only used when an
147-
// custom deallocator is specified.
145+
/// A block outside of the extraction set where previously introduced
146+
/// intermediate allocations can be deallocated. This is only used when a
147+
/// custom deallocator is specified.
148148
BasicBlock *DeallocationBlock;
149149

150-
// If set, this callback will be used to deallocate the arguments in the
151-
// caller after running the outlined function holding the extracted piece of
152-
// code. It will not be called if a custom allocator isn't also present.
153-
//
154-
// By default, this will be done at the end of the basic block containing
155-
// the call to the outlined function, except if a deallocation block is
156-
// specified. In that case, that will take precedence.
150+
/// If set, this callback will be used to deallocate the arguments in the
151+
/// caller after running the outlined function holding the extracted piece
152+
/// of code. It will not be called if a custom allocator isn't also present.
153+
///
154+
/// By default, this will be done at the end of the basic block containing
155+
/// the call to the outlined function, except if a deallocation block is
156+
/// specified. In that case, that will take precedence.
157157
CustomArgDeallocatorCBTy *CustomArgDeallocatorCB;
158158

159159
public:

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ computeOpenMPScheduleType(ScheduleKind ClauseKind, bool HasChunks,
281281
}
282282

283283
/// Given a function, if it represents the entry point of a target kernel, this
284-
/// returns the execution mode flags associated to that kernel.
284+
/// returns the execution mode flags associated with that kernel.
285285
static std::optional<omp::OMPTgtExecModeFlags>
286286
getTargetKernelExecMode(Function &Kernel) {
287287
CallInst *TargetInitCall = nullptr;

llvm/lib/Transforms/Utils/CodeExtractor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,10 @@ CodeExtractor::CodeExtractor(ArrayRef<BasicBlock *> BBs, DominatorTree *DT,
275275
Suffix(Suffix), ArgsInZeroAddressSpace(ArgsInZeroAddressSpace),
276276
CustomArgAllocatorCB(CustomArgAllocatorCB),
277277
DeallocationBlock(DeallocationBlock),
278-
CustomArgDeallocatorCB(CustomArgDeallocatorCB) {}
278+
CustomArgDeallocatorCB(CustomArgDeallocatorCB) {
279+
assert((!CustomArgDeallocatorCB || CustomArgAllocatorCB) &&
280+
"custom deallocator only allowed if a custom allocator is provided");
281+
}
279282

280283
/// definedInRegion - Return true if the specified value is defined in the
281284
/// extracted region.

0 commit comments

Comments
 (0)