Skip to content

Commit 6a45873

Browse files
committed
[Flang][MLIR] Add !$omp unroll construct and omp.unroll_heuristic modeling
1 parent 383b326 commit 6a45873

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1718
-35
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 158 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,161 @@ genLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
21282128
return loopOp;
21292129
}
21302130

2131+
static mlir::omp::CanonicalLoopOp
2132+
genCanonicalLoopOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
2133+
semantics::SemanticsContext &semaCtx,
2134+
lower::pft::Evaluation &eval, mlir::Location loc,
2135+
const ConstructQueue &queue,
2136+
ConstructQueue::const_iterator item,
2137+
llvm::ArrayRef<const semantics::Symbol *> ivs,
2138+
llvm::omp::Directive directive, DataSharingProcessor &dsp) {
2139+
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
2140+
2141+
assert(ivs.size() == 1 && "Nested loops not yet implemented");
2142+
const semantics::Symbol *iv = ivs[0];
2143+
2144+
auto &nestedEval = eval.getFirstNestedEvaluation();
2145+
if (nestedEval.getIf<parser::DoConstruct>()->IsDoConcurrent()) {
2146+
TODO(loc, "Do Concurrent in unroll construct");
2147+
}
2148+
2149+
// Get the loop bounds (and increment)
2150+
auto &doLoopEval = nestedEval.getFirstNestedEvaluation();
2151+
auto *doStmt = doLoopEval.getIf<parser::NonLabelDoStmt>();
2152+
assert(doStmt && "Expected do loop to be in the nested evaluation");
2153+
auto &loopControl = std::get<std::optional<parser::LoopControl>>(doStmt->t);
2154+
assert(loopControl.has_value());
2155+
auto *bounds = std::get_if<parser::LoopControl::Bounds>(&loopControl->u);
2156+
assert(bounds && "Expected bounds for canonical loop");
2157+
lower::StatementContext stmtCtx;
2158+
mlir::Value loopLBVar = fir::getBase(
2159+
converter.genExprValue(*semantics::GetExpr(bounds->lower), stmtCtx));
2160+
mlir::Value loopUBVar = fir::getBase(
2161+
converter.genExprValue(*semantics::GetExpr(bounds->upper), stmtCtx));
2162+
mlir::Value loopStepVar = [&]() {
2163+
if (bounds->step) {
2164+
return fir::getBase(
2165+
converter.genExprValue(*semantics::GetExpr(bounds->step), stmtCtx));
2166+
} else {
2167+
// If `step` is not present, assume it is `1`.
2168+
return firOpBuilder.createIntegerConstant(loc, firOpBuilder.getI32Type(),
2169+
1);
2170+
}
2171+
}();
2172+
2173+
// Get the integer kind for the loop variable and cast the loop bounds
2174+
size_t loopVarTypeSize = bounds->name.thing.symbol->GetUltimate().size();
2175+
mlir::Type loopVarType = getLoopVarType(converter, loopVarTypeSize);
2176+
loopLBVar = firOpBuilder.createConvert(loc, loopVarType, loopLBVar);
2177+
loopUBVar = firOpBuilder.createConvert(loc, loopVarType, loopUBVar);
2178+
loopStepVar = firOpBuilder.createConvert(loc, loopVarType, loopStepVar);
2179+
2180+
// Start lowering
2181+
mlir::Value zero = firOpBuilder.createIntegerConstant(loc, loopVarType, 0);
2182+
mlir::Value one = firOpBuilder.createIntegerConstant(loc, loopVarType, 1);
2183+
mlir::Value isDownwards = firOpBuilder.create<mlir::arith::CmpIOp>(
2184+
loc, mlir::arith::CmpIPredicate::slt, loopStepVar, zero);
2185+
2186+
// Ensure we are counting upwards. If not, negate step and swap lb and ub.
2187+
mlir::Value negStep =
2188+
firOpBuilder.create<mlir::arith::SubIOp>(loc, zero, loopStepVar);
2189+
mlir::Value incr = firOpBuilder.create<mlir::arith::SelectOp>(
2190+
loc, isDownwards, negStep, loopStepVar);
2191+
mlir::Value lb = firOpBuilder.create<mlir::arith::SelectOp>(
2192+
loc, isDownwards, loopUBVar, loopLBVar);
2193+
mlir::Value ub = firOpBuilder.create<mlir::arith::SelectOp>(
2194+
loc, isDownwards, loopLBVar, loopUBVar);
2195+
2196+
// Compute the trip count assuming lb <= ub. This guarantees that the result
2197+
// is non-negative and we can use unsigned arithmetic.
2198+
mlir::Value span = firOpBuilder.create<mlir::arith::SubIOp>(
2199+
loc, ub, lb, ::mlir::arith::IntegerOverflowFlags::nuw);
2200+
mlir::Value tcMinusOne =
2201+
firOpBuilder.create<mlir::arith::DivUIOp>(loc, span, incr);
2202+
mlir::Value tcIfLooping = firOpBuilder.create<mlir::arith::AddIOp>(
2203+
loc, tcMinusOne, one, ::mlir::arith::IntegerOverflowFlags::nuw);
2204+
2205+
// Fall back to 0 if lb > ub
2206+
mlir::Value isZeroTC = firOpBuilder.create<mlir::arith::CmpIOp>(
2207+
loc, mlir::arith::CmpIPredicate::slt, ub, lb);
2208+
mlir::Value tripcount = firOpBuilder.create<mlir::arith::SelectOp>(
2209+
loc, isZeroTC, zero, tcIfLooping);
2210+
2211+
// Create the CLI handle.
2212+
auto newcli = firOpBuilder.create<mlir::omp::NewCliOp>(loc);
2213+
mlir::Value cli = newcli.getResult();
2214+
2215+
auto ivCallback = [&](mlir::Operation *op)
2216+
-> llvm::SmallVector<const Fortran::semantics::Symbol *> {
2217+
mlir::Region &region = op->getRegion(0);
2218+
2219+
// Create the op's region skeleton (BB taking the iv as argument)
2220+
firOpBuilder.createBlock(&region, {}, {loopVarType}, {loc});
2221+
2222+
// Compute the value of the loop variable from the logical iteration number.
2223+
mlir::Value natIterNum = fir::getBase(region.front().getArgument(0));
2224+
mlir::Value scaled =
2225+
firOpBuilder.create<mlir::arith::MulIOp>(loc, natIterNum, loopStepVar);
2226+
mlir::Value userVal =
2227+
firOpBuilder.create<mlir::arith::AddIOp>(loc, loopLBVar, scaled);
2228+
2229+
// The argument is not currently in memory, so make a temporary for the
2230+
// argument, and store it there, then bind that location to the argument.
2231+
mlir::Operation *storeOp =
2232+
createAndSetPrivatizedLoopVar(converter, loc, userVal, iv);
2233+
2234+
firOpBuilder.setInsertionPointAfter(storeOp);
2235+
return {iv};
2236+
};
2237+
2238+
// Create the omp.canonical_loop operation
2239+
auto canonLoop = genOpWithBody<mlir::omp::CanonicalLoopOp>(
2240+
OpWithBodyGenInfo(converter, symTable, semaCtx, loc, nestedEval,
2241+
directive)
2242+
.setClauses(&item->clauses)
2243+
.setDataSharingProcessor(&dsp)
2244+
.setGenRegionEntryCb(ivCallback),
2245+
queue, item, tripcount, cli);
2246+
2247+
firOpBuilder.setInsertionPointAfter(canonLoop);
2248+
return canonLoop;
2249+
}
2250+
2251+
static void genUnrollOp(Fortran::lower::AbstractConverter &converter,
2252+
Fortran::lower::SymMap &symTable,
2253+
lower::StatementContext &stmtCtx,
2254+
Fortran::semantics::SemanticsContext &semaCtx,
2255+
Fortran::lower::pft::Evaluation &eval,
2256+
mlir::Location loc, const ConstructQueue &queue,
2257+
ConstructQueue::const_iterator item) {
2258+
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
2259+
2260+
mlir::omp::LoopRelatedClauseOps loopInfo;
2261+
llvm::SmallVector<const semantics::Symbol *> iv;
2262+
collectLoopRelatedInfo(converter, loc, eval, item->clauses, loopInfo, iv);
2263+
2264+
// Clauses for unrolling not yet implemnted
2265+
ClauseProcessor cp(converter, semaCtx, item->clauses);
2266+
cp.processTODO<clause::Partial, clause::Full>(
2267+
loc, llvm::omp::Directive::OMPD_unroll);
2268+
2269+
// Even though unroll does not support data-sharing clauses, but this is
2270+
// required to fill the symbol table.
2271+
DataSharingProcessor dsp(converter, semaCtx, item->clauses, eval,
2272+
/*shouldCollectPreDeterminedSymbols=*/true,
2273+
/*useDelayedPrivatization=*/false, symTable);
2274+
dsp.processStep1();
2275+
2276+
// Emit the associated loop
2277+
auto canonLoop =
2278+
genCanonicalLoopOp(converter, symTable, semaCtx, eval, loc, queue, item,
2279+
iv, llvm::omp::Directive::OMPD_unroll, dsp);
2280+
2281+
// Apply unrolling to it
2282+
auto cli = canonLoop.getCli();
2283+
firOpBuilder.create<mlir::omp::UnrollHeuristicOp>(loc, cli);
2284+
}
2285+
21312286
static mlir::omp::MaskedOp
21322287
genMaskedOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
21332288
lower::StatementContext &stmtCtx,
@@ -3516,12 +3671,9 @@ static void genOMPDispatch(lower::AbstractConverter &converter,
35163671
newOp = genTeamsOp(converter, symTable, stmtCtx, semaCtx, eval, loc, queue,
35173672
item);
35183673
break;
3519-
case llvm::omp::Directive::OMPD_tile:
3520-
case llvm::omp::Directive::OMPD_unroll: {
3521-
unsigned version = semaCtx.langOptions().OpenMPVersion;
3522-
TODO(loc, "Unhandled loop directive (" +
3523-
llvm::omp::getOpenMPDirectiveName(dir, version) + ")");
3524-
}
3674+
case llvm::omp::Directive::OMPD_unroll:
3675+
genUnrollOp(converter, symTable, stmtCtx, semaCtx, eval, loc, queue, item);
3676+
break;
35253677
// case llvm::omp::Directive::OMPD_workdistribute:
35263678
case llvm::omp::Directive::OMPD_workshare:
35273679
newOp = genWorkshareOp(converter, symTable, stmtCtx, semaCtx, eval, loc,

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-as

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.bfd

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld.gold

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-as

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.bfd

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld.gold

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/as

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.bfd

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld.gold

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/as

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.bfd

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.gold

100755100644
File mode changed.

flang/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.lld

100755100644
File mode changed.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=51 -o - %s 2>&1 | FileCheck %s
2+
3+
4+
subroutine omp_unroll_heuristic01(lb, ub, inc)
5+
integer res, i, lb, ub, inc
6+
7+
!$omp unroll
8+
do i = lb, ub, inc
9+
res = i
10+
end do
11+
!$omp end unroll
12+
13+
end subroutine omp_unroll_heuristic01
14+
15+
16+
!CHECK-LABEL: func.func @_QPomp_unroll_heuristic01(
17+
!CHECK: %c0_i32 = arith.constant 0 : i32
18+
!CHECK-NEXT: %c1_i32 = arith.constant 1 : i32
19+
!CHECK-NEXT: %13 = arith.cmpi slt, %12, %c0_i32 : i32
20+
!CHECK-NEXT: %14 = arith.subi %c0_i32, %12 : i32
21+
!CHECK-NEXT: %15 = arith.select %13, %14, %12 : i32
22+
!CHECK-NEXT: %16 = arith.select %13, %11, %10 : i32
23+
!CHECK-NEXT: %17 = arith.select %13, %10, %11 : i32
24+
!CHECK-NEXT: %18 = arith.subi %17, %16 overflow<nuw> : i32
25+
!CHECK-NEXT: %19 = arith.divui %18, %15 : i32
26+
!CHECK-NEXT: %20 = arith.addi %19, %c1_i32 overflow<nuw> : i32
27+
!CHECK-NEXT: %21 = arith.cmpi slt, %17, %16 : i32
28+
!CHECK-NEXT: %22 = arith.select %21, %c0_i32, %20 : i32
29+
!CHECK-NEXT: %canonloop_s0 = omp.new_cli
30+
!CHECK-NEXT: omp.canonical_loop(%canonloop_s0) %iv : i32 in range(%22) {
31+
!CHECK-NEXT: %23 = arith.muli %iv, %12 : i32
32+
!CHECK-NEXT: %24 = arith.addi %10, %23 : i32
33+
!CHECK-NEXT: hlfir.assign %24 to %9#0 : i32, !fir.ref<i32>
34+
!CHECK-NEXT: %25 = fir.load %9#0 : !fir.ref<i32>
35+
!CHECK-NEXT: hlfir.assign %25 to %6#0 : i32, !fir.ref<i32>
36+
!CHECK-NEXT: omp.terminator
37+
!CHECK-NEXT: }
38+
!CHECK-NEXT: omp.unroll_heuristic(%canonloop_s0)
39+
!CHECK-NEXT: return
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=51 -o - %s 2>&1 | FileCheck %s
2+
3+
4+
subroutine omp_unroll_heuristic_nested02(outer_lb, outer_ub, outer_inc, inner_lb, inner_ub, inner_inc)
5+
integer res, i, j, inner_lb, inner_ub, inner_inc, outer_lb, outer_ub, outer_inc
6+
7+
!$omp unroll
8+
do i = outer_lb, outer_ub, outer_inc
9+
!$omp unroll
10+
do j = inner_lb, inner_ub, inner_inc
11+
res = i + j
12+
end do
13+
!$omp end unroll
14+
end do
15+
!$omp end unroll
16+
17+
end subroutine omp_unroll_heuristic_nested02
18+
19+
20+
!CHECK-LABEL: func.func @_QPomp_unroll_heuristic_nested02(%arg0: !fir.ref<i32> {fir.bindc_name = "outer_lb"}, %arg1: !fir.ref<i32> {fir.bindc_name = "outer_ub"}, %arg2: !fir.ref<i32> {fir.bindc_name = "outer_inc"}, %arg3: !fir.ref<i32> {fir.bindc_name = "inner_lb"}, %arg4: !fir.ref<i32> {fir.bindc_name = "inner_ub"}, %arg5: !fir.ref<i32> {fir.bindc_name = "inner_inc"}) {
21+
!CHECK: %c0_i32 = arith.constant 0 : i32
22+
!CHECK-NEXT: %c1_i32 = arith.constant 1 : i32
23+
!CHECK-NEXT: %18 = arith.cmpi slt, %17, %c0_i32 : i32
24+
!CHECK-NEXT: %19 = arith.subi %c0_i32, %17 : i32
25+
!CHECK-NEXT: %20 = arith.select %18, %19, %17 : i32
26+
!CHECK-NEXT: %21 = arith.select %18, %16, %15 : i32
27+
!CHECK-NEXT: %22 = arith.select %18, %15, %16 : i32
28+
!CHECK-NEXT: %23 = arith.subi %22, %21 overflow<nuw> : i32
29+
!CHECK-NEXT: %24 = arith.divui %23, %20 : i32
30+
!CHECK-NEXT: %25 = arith.addi %24, %c1_i32 overflow<nuw> : i32
31+
!CHECK-NEXT: %26 = arith.cmpi slt, %22, %21 : i32
32+
!CHECK-NEXT: %27 = arith.select %26, %c0_i32, %25 : i32
33+
!CHECK-NEXT: %canonloop_s0 = omp.new_cli
34+
!CHECK-NEXT: omp.canonical_loop(%canonloop_s0) %iv : i32 in range(%27) {
35+
!CHECK-NEXT: %28 = arith.muli %iv, %17 : i32
36+
!CHECK-NEXT: %29 = arith.addi %15, %28 : i32
37+
!CHECK-NEXT: hlfir.assign %29 to %14#0 : i32, !fir.ref<i32>
38+
!CHECK-NEXT: %30 = fir.alloca i32 {bindc_name = "j", pinned, uniq_name = "_QFomp_unroll_heuristic_nested02Ej"}
39+
!CHECK-NEXT: %31:2 = hlfir.declare %30 {uniq_name = "_QFomp_unroll_heuristic_nested02Ej"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
40+
!CHECK-NEXT: %32 = fir.load %4#0 : !fir.ref<i32>
41+
!CHECK-NEXT: %33 = fir.load %5#0 : !fir.ref<i32>
42+
!CHECK-NEXT: %34 = fir.load %3#0 : !fir.ref<i32>
43+
!CHECK-NEXT: %c0_i32_0 = arith.constant 0 : i32
44+
!CHECK-NEXT: %c1_i32_1 = arith.constant 1 : i32
45+
!CHECK-NEXT: %35 = arith.cmpi slt, %34, %c0_i32_0 : i32
46+
!CHECK-NEXT: %36 = arith.subi %c0_i32_0, %34 : i32
47+
!CHECK-NEXT: %37 = arith.select %35, %36, %34 : i32
48+
!CHECK-NEXT: %38 = arith.select %35, %33, %32 : i32
49+
!CHECK-NEXT: %39 = arith.select %35, %32, %33 : i32
50+
!CHECK-NEXT: %40 = arith.subi %39, %38 overflow<nuw> : i32
51+
!CHECK-NEXT: %41 = arith.divui %40, %37 : i32
52+
!CHECK-NEXT: %42 = arith.addi %41, %c1_i32_1 overflow<nuw> : i32
53+
!CHECK-NEXT: %43 = arith.cmpi slt, %39, %38 : i32
54+
!CHECK-NEXT: %44 = arith.select %43, %c0_i32_0, %42 : i32
55+
!CHECK-NEXT: %canonloop_s0_s0 = omp.new_cli
56+
!CHECK-NEXT: omp.canonical_loop(%canonloop_s0_s0) %iv_2 : i32 in range(%44) {
57+
!CHECK-NEXT: %45 = arith.muli %iv_2, %34 : i32
58+
!CHECK-NEXT: %46 = arith.addi %32, %45 : i32
59+
!CHECK-NEXT: hlfir.assign %46 to %31#0 : i32, !fir.ref<i32>
60+
!CHECK-NEXT: %47 = fir.load %14#0 : !fir.ref<i32>
61+
!CHECK-NEXT: %48 = fir.load %31#0 : !fir.ref<i32>
62+
!CHECK-NEXT: %49 = arith.addi %47, %48 : i32
63+
!CHECK-NEXT: hlfir.assign %49 to %12#0 : i32, !fir.ref<i32>
64+
!CHECK-NEXT: omp.terminator
65+
!CHECK-NEXT: }
66+
!CHECK-NEXT: omp.unroll_heuristic(%canonloop_s0_s0)
67+
!CHECK-NEXT: omp.terminator
68+
!CHECK-NEXT: }
69+
!CHECK-NEXT: omp.unroll_heuristic(%canonloop_s0)
70+
!CHECK-NEXT: return

flang/test/Parser/OpenMP/unroll-full.f90

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
! RUN: %flang_fc1 -fopenmp -fopenmp-version=51 %s -fdebug-unparse | FileCheck --check-prefix=UNPARSE %s
2+
! RUN: %flang_fc1 -fopenmp -fopenmp-version=51 %s -fdebug-dump-parse-tree | FileCheck --check-prefix=PTREE %s
3+
4+
subroutine openmp_parse_unroll_heuristic
5+
integer i
6+
7+
!$omp unroll
8+
do i = 1, 100
9+
call func(i)
10+
end do
11+
!$omp end unroll
12+
END subroutine openmp_parse_unroll_heuristic
13+
14+
15+
!UNPARSE: !$OMP UNROLL
16+
!UNPARSE-NEXT: DO i=1_4,100_4
17+
!UNPARSE-NEXT: CALL func(i)
18+
!UNPARSE-NEXT: END DO
19+
!UNPARSE-NEXT: !$OMP END UNROLL
20+
21+
!PTREE: OpenMPConstruct -> OpenMPLoopConstruct
22+
!PTREE-NEXT: | OmpBeginLoopDirective
23+
!PTREE-NEXT: | | OmpLoopDirective -> llvm::omp::Directive = unroll
24+
!PTREE-NEXT: | | OmpClauseList ->
25+
!PTREE-NEXT: | DoConstruct
26+
!PTREE-NEXT: | | NonLabelDoStmt
27+
!PTREE-NEXT: | | | LoopControl -> LoopBounds
28+
!PTREE-NEXT: | | | | Scalar -> Name = 'i'
29+
!PTREE-NEXT: | | | | Scalar -> Expr = '1_4'
30+
!PTREE-NEXT: | | | | | LiteralConstant -> IntLiteralConstant = '1'
31+
!PTREE-NEXT: | | | | Scalar -> Expr = '100_4'
32+
!PTREE-NEXT: | | | | | LiteralConstant -> IntLiteralConstant = '100'
33+
!PTREE-NEXT: | | Block
34+
!PTREE-NEXT: | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> CallStmt = 'CALL func(i)'
35+
!PTREE-NEXT: | | | | | | Call
36+
!PTREE-NEXT: | | | | | ProcedureDesignator -> Name = 'func'
37+
!PTREE-NEXT: | | | | | ActualArgSpec
38+
!PTREE-NEXT: | | | | | | ActualArg -> Expr = 'i'
39+
!PTREE-NEXT: | | | | | | | Designator -> DataRef -> Name = 'i'
40+
!PTREE-NEXT: | | EndDoStmt ->
41+
!PTREE-NEXT: | OmpEndLoopDirective
42+
!PTREE-NEXT: | | OmpLoopDirective -> llvm::omp::Directive = unroll
43+
!PTREE-NEXT: | | OmpClauseList ->

mlir/include/mlir/Dialect/OpenMP/OpenMPClauseOperands.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@
1515
#ifndef MLIR_DIALECT_OPENMP_OPENMPCLAUSEOPERANDS_H_
1616
#define MLIR_DIALECT_OPENMP_OPENMPCLAUSEOPERANDS_H_
1717

18+
#include "mlir/Dialect/OpenMP/OpenMPOpsAttributes.h"
1819
#include "mlir/IR/BuiltinAttributes.h"
1920
#include "llvm/ADT/SmallVector.h"
2021

21-
#include "mlir/Dialect/OpenMP/OpenMPOpsEnums.h.inc"
22-
23-
#define GET_ATTRDEF_CLASSES
24-
#include "mlir/Dialect/OpenMP/OpenMPOpsAttributes.h.inc"
25-
2622
#include "mlir/Dialect/OpenMP/OpenMPClauseOps.h.inc"
2723

2824
namespace mlir {

0 commit comments

Comments
 (0)