@@ -512,7 +512,6 @@ class OpenMPIRBuilder {
512
512
return allocaInst;
513
513
}
514
514
};
515
-
516
515
// / Initialize the internal state, this will put structures types and
517
516
// / potentially other helpers into the underlying module. Must be called
518
517
// / before any other method and only once! This internal state includes types
@@ -782,8 +781,8 @@ class OpenMPIRBuilder {
782
781
// / at the outermost loop of a loop nest. If not set,
783
782
// / defaults to the preheader of the generated loop.
784
783
// / \param Name Base name used to derive BB and instruction names.
785
- // / \param ScanRedInfo Pointer to the ScanInfo objected created using
786
- // / `ScanInfoInitialize`.
784
+ // / \param ScanRedInfo Pointer to the ScanInfo objected created using
785
+ // / `ScanInfoInitialize`.
787
786
// /
788
787
// / \returns A vector containing Loop Info of Input Loop and Scan Loop.
789
788
Expected<SmallVector<llvm::CanonicalLoopInfo *>> createCanonicalScanLoops (
@@ -861,7 +860,7 @@ class OpenMPIRBuilder {
861
860
// / \param Name Base name used to derive BB and instruction names.
862
861
// / \param InScan Whether loop has a scan reduction specified.
863
862
// / \param ScanRedInfo Pointer to the ScanInfo objected created using
864
- // / `ScanInfoInitialize`.
863
+ // / `ScanInfoInitialize`.
865
864
// /
866
865
// / \returns An object representing the created control flow structure which
867
866
// / can be used for loop-associated directives.
@@ -1604,9 +1603,9 @@ class OpenMPIRBuilder {
1604
1603
// / Helper function for CreateCanonicalScanLoops to create InputLoop
1605
1604
// / in the firstGen and Scan Loop in the SecondGen
1606
1605
// / \param InputLoopGen Callback for generating the loop for input phase
1607
- // / \param ScanLoopGen Callback for generating the loop for scan phase
1606
+ // / \param ScanLoopGen Callback for generating the loop for scan phase
1608
1607
// / \param ScanRedInfo Pointer to the ScanInfo objected created using
1609
- // / `ScanInfoInitialize`.
1608
+ // / `ScanInfoInitialize`.
1610
1609
// /
1611
1610
// / \return error if any produced, else return success.
1612
1611
Error emitScanBasedDirectiveIR (
@@ -1615,15 +1614,16 @@ class OpenMPIRBuilder {
1615
1614
ScanInfo *ScanRedInfo);
1616
1615
1617
1616
// / Creates the basic blocks required for scan reduction.
1618
- // / \param ScanRedInfo Pointer to the ScanInfo objected created using
1619
- // / `ScanInfoInitialize`.
1617
+ // / \param ScanRedInfo Pointer to the ScanInfo objected created using
1618
+ // / `ScanInfoInitialize`.
1620
1619
void createScanBBs (ScanInfo *ScanRedInfo);
1621
1620
1622
1621
// / 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`.
1622
+ // / \param AllocaIP The IP where possibly-shared pointer of buffer needs to
1623
+ // / be declared.
1624
+ // / \param ScanVars Scan Variables.
1625
+ // / \param ScanRedInfo Pointer to the ScanInfo objected created using
1626
+ // / `ScanInfoInitialize`.
1627
1627
// /
1628
1628
// / \return error if any produced, else return success.
1629
1629
Error emitScanBasedDirectiveDeclsIR (InsertPointTy AllocaIP,
@@ -1633,8 +1633,8 @@ class OpenMPIRBuilder {
1633
1633
1634
1634
// / Copies the result back to the reduction variable.
1635
1635
// / \param ReductionInfos Array type containing the ReductionOps.
1636
- // / \param ScanRedInfo Pointer to the ScanInfo objected created using
1637
- // / `ScanInfoInitialize`.
1636
+ // / \param ScanRedInfo Pointer to the ScanInfo objected created using
1637
+ // / `ScanInfoInitialize`.
1638
1638
// /
1639
1639
// / \return error if any produced, else return success.
1640
1640
Error emitScanBasedDirectiveFinalsIR (
@@ -2268,6 +2268,8 @@ class OpenMPIRBuilder {
2268
2268
// / Collection of owned canonical loop objects that eventually need to be
2269
2269
// / free'd.
2270
2270
std::forward_list<CanonicalLoopInfo> LoopInfos;
2271
+
2272
+ // / Collection of owned ScanInfo objects that eventually need to be free'd.
2271
2273
std::forward_list<ScanInfo> ScanInfos;
2272
2274
2273
2275
// / Add a new region that will be outlined later.
@@ -2730,16 +2732,17 @@ class OpenMPIRBuilder {
2730
2732
// / and scan loop returned by `CreateCanonicalScanLoops`. The following
2731
2733
// / is the code that is generated, `buffer` and `span` are expected to be
2732
2734
// / 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
- // / }
2735
+ // / \code{c}
2736
+ // / for (int k = 0; k != ceil(log2(span)); ++k) {
2737
+ // / i=pow(2,k)
2738
+ // / for (size cnt = last_iter; cnt >= i; --cnt)
2739
+ // / buffer[cnt] op= buffer[cnt-i];
2740
+ // / }
2741
+ // / \endcode
2739
2742
// / \param Loc The insert and source location description.
2740
2743
// / \param ReductionInfos Array type containing the ReductionOps.
2741
- // / \param ScanRedInfo Pointer to the ScanInfo objected created using
2742
- // / `ScanInfoInitialize`.
2744
+ // / \param ScanRedInfo Pointer to the ScanInfo objected created using
2745
+ // / `ScanInfoInitialize`.
2743
2746
// /
2744
2747
// / \returns The insertion position *after* the masked.
2745
2748
InsertPointOrErrorTy emitScanReduction (
@@ -2752,19 +2755,20 @@ class OpenMPIRBuilder {
2752
2755
// / is executed, 2. whether exclusive or inclusive scan is used.
2753
2756
// /
2754
2757
// / \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.
2758
+ // / \param AllocaIP The IP where the temporary buffer for scan reduction
2759
+ // needs to be allocated.
2760
+ // / \param ScanVars Scan Variables.
2758
2761
// / \param IsInclusive Whether it is an inclusive or exclusive scan.
2759
- // / \param ScanRedInfo Pointer to the ScanInfo objected created using
2760
- // / `ScanInfoInitialize`.
2762
+ // / \param ScanRedInfo Pointer to the ScanInfo objected created using
2763
+ // / `ScanInfoInitialize`.
2761
2764
// /
2762
2765
// / \returns The insertion position *after* the scan.
2763
2766
InsertPointOrErrorTy createScan (const LocationDescription &Loc,
2764
2767
InsertPointTy AllocaIP,
2765
2768
ArrayRef<llvm::Value *> ScanVars,
2766
2769
ArrayRef<llvm::Type *> ScanVarsType,
2767
2770
bool IsInclusive, ScanInfo *ScanRedInfo);
2771
+
2768
2772
// / Generator for '#omp critical'
2769
2773
// /
2770
2774
// / \param Loc The insert and source location description.
0 commit comments