Skip to content

Commit 0c970b0

Browse files
committed
R4: Addressing review comments
1 parent e923c69 commit 0c970b0

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ class OpenMPIRBuilder {
782782
/// at the outermost loop of a loop nest. If not set,
783783
/// defaults to the preheader of the generated loop.
784784
/// \param Name Base name used to derive BB and instruction names.
785-
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
786-
/// `ScanInfoInitialize`.
785+
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
786+
/// `ScanInfoInitialize`.
787787
///
788788
/// \returns A vector containing Loop Info of Input Loop and Scan Loop.
789789
Expected<SmallVector<llvm::CanonicalLoopInfo *>> createCanonicalScanLoops(
@@ -861,7 +861,7 @@ class OpenMPIRBuilder {
861861
/// \param Name Base name used to derive BB and instruction names.
862862
/// \param InScan Whether loop has a scan reduction specified.
863863
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
864-
/// `ScanInfoInitialize`.
864+
/// `ScanInfoInitialize`.
865865
///
866866
/// \returns An object representing the created control flow structure which
867867
/// can be used for loop-associated directives.
@@ -1604,9 +1604,9 @@ class OpenMPIRBuilder {
16041604
/// Helper function for CreateCanonicalScanLoops to create InputLoop
16051605
/// in the firstGen and Scan Loop in the SecondGen
16061606
/// \param InputLoopGen Callback for generating the loop for input phase
1607-
/// \param ScanLoopGen Callback for generating the loop for scan phase
1607+
/// \param ScanLoopGen Callback for generating the loop for scan phase
16081608
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
1609-
/// `ScanInfoInitialize`.
1609+
/// `ScanInfoInitialize`.
16101610
///
16111611
/// \return error if any produced, else return success.
16121612
Error emitScanBasedDirectiveIR(
@@ -1615,15 +1615,16 @@ class OpenMPIRBuilder {
16151615
ScanInfo *ScanRedInfo);
16161616

16171617
/// Creates the basic blocks required for scan reduction.
1618-
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
1619-
/// `ScanInfoInitialize`.
1618+
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
1619+
/// `ScanInfoInitialize`.
16201620
void createScanBBs(ScanInfo *ScanRedInfo);
16211621

16221622
/// Dynamically allocates the buffer needed for scan reduction.
1623-
/// \param AllocaIP The IP where possibly-shared pointer of buffer needs to be
1624-
/// declared. \param ScanVars Scan Variables.
1625-
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
1626-
/// `ScanInfoInitialize`.
1623+
/// \param AllocaIP The IP where possibly-shared pointer of buffer needs to
1624+
/// be declared.
1625+
/// \param ScanVars Scan Variables.
1626+
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
1627+
/// `ScanInfoInitialize`.
16271628
///
16281629
/// \return error if any produced, else return success.
16291630
Error emitScanBasedDirectiveDeclsIR(InsertPointTy AllocaIP,
@@ -1633,8 +1634,8 @@ class OpenMPIRBuilder {
16331634

16341635
/// Copies the result back to the reduction variable.
16351636
/// \param ReductionInfos Array type containing the ReductionOps.
1636-
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
1637-
/// `ScanInfoInitialize`.
1637+
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
1638+
/// `ScanInfoInitialize`.
16381639
///
16391640
/// \return error if any produced, else return success.
16401641
Error emitScanBasedDirectiveFinalsIR(
@@ -2730,16 +2731,17 @@ class OpenMPIRBuilder {
27302731
/// and scan loop returned by `CreateCanonicalScanLoops`. The following
27312732
/// is the code that is generated, `buffer` and `span` are expected to be
27322733
/// populated before executing the generated code.
2733-
///
2734-
/// for (int k = 0; k != ceil(log2(span)); ++k) {
2735-
/// i=pow(2,k)
2736-
/// for (size cnt = last_iter; cnt >= i; --cnt)
2737-
/// buffer[cnt] op= buffer[cnt-i];
2738-
/// }
2734+
/// \code{c}
2735+
/// for (int k = 0; k != ceil(log2(span)); ++k) {
2736+
/// i=pow(2,k)
2737+
/// for (size cnt = last_iter; cnt >= i; --cnt)
2738+
/// buffer[cnt] op= buffer[cnt-i];
2739+
/// }
2740+
/// \endcode
27392741
/// \param Loc The insert and source location description.
27402742
/// \param ReductionInfos Array type containing the ReductionOps.
2741-
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
2742-
/// `ScanInfoInitialize`.
2743+
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
2744+
/// `ScanInfoInitialize`.
27432745
///
27442746
/// \returns The insertion position *after* the masked.
27452747
InsertPointOrErrorTy emitScanReduction(
@@ -2752,19 +2754,20 @@ class OpenMPIRBuilder {
27522754
/// is executed, 2. whether exclusive or inclusive scan is used.
27532755
///
27542756
/// \param Loc The insert and source location description.
2755-
/// \param AllocaIP The IP where the temporary buffer for scan reduction
2756-
// needs to be allocated.
2757-
/// \param ScanVars Scan Variables.
2757+
/// \param AllocaIP The IP where the temporary buffer for scan reduction
2758+
// needs to be allocated.
2759+
/// \param ScanVars Scan Variables.
27582760
/// \param IsInclusive Whether it is an inclusive or exclusive scan.
2759-
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
2760-
/// `ScanInfoInitialize`.
2761+
/// \param ScanRedInfo Pointer to the ScanInfo objected created using
2762+
/// `ScanInfoInitialize`.
27612763
///
27622764
/// \returns The insertion position *after* the scan.
27632765
InsertPointOrErrorTy createScan(const LocationDescription &Loc,
27642766
InsertPointTy AllocaIP,
27652767
ArrayRef<llvm::Value *> ScanVars,
27662768
ArrayRef<llvm::Type *> ScanVarsType,
27672769
bool IsInclusive, ScanInfo *ScanRedInfo);
2770+
27682771
/// Generator for '#omp critical'
27692772
///
27702773
/// \param Loc The insert and source location description.

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
//===- OpenMPIRBuilder.cpp - Builder for LLVM-IR for OpenMP directives ----===//
32
//
43
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -60,8 +59,6 @@
6059
#include "llvm/Transforms/Utils/LoopPeel.h"
6160
#include "llvm/Transforms/Utils/UnrollLoop.h"
6261

63-
#include <cassert>
64-
#include <cstddef>
6562
#include <cstdint>
6663
#include <optional>
6764

@@ -4024,10 +4021,10 @@ OpenMPIRBuilder::createMasked(const LocationDescription &Loc,
40244021
/*Conditional*/ true, /*hasFinalize*/ true);
40254022
}
40264023

4027-
llvm::CallInst *emitNoUnwindRuntimeCall(IRBuilder<> &Builder,
4028-
llvm::FunctionCallee Callee,
4029-
ArrayRef<llvm::Value *> Args,
4030-
const llvm::Twine &Name) {
4024+
static llvm::CallInst *emitNoUnwindRuntimeCall(IRBuilder<> &Builder,
4025+
llvm::FunctionCallee Callee,
4026+
ArrayRef<llvm::Value *> Args,
4027+
const llvm::Twine &Name) {
40314028
llvm::CallInst *Call = Builder.CreateCall(
40324029
Callee, Args, SmallVector<llvm::OperandBundleDef, 1>(), Name);
40334030
Call->setDoesNotThrow();

0 commit comments

Comments
 (0)