Skip to content

Commit a687d97

Browse files
committed
Address review comments
1 parent 4f2f7eb commit a687d97

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
using namespace Fortran::lower::omp;
5050
using namespace Fortran::common::openmp;
5151
using namespace Fortran::utils::openmp;
52-
using namespace Fortran::semantics;
5352

5453
//===----------------------------------------------------------------------===//
5554
// Code generation helper functions

flang/lib/Lower/OpenMP/Utils.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,23 @@
3131

3232
#include <iterator>
3333

34-
using namespace Fortran::semantics;
35-
3634
template <typename T>
37-
MaybeIntExpr EvaluateIntExpr(SemanticsContext &context, const T &expr) {
38-
if (MaybeExpr maybeExpr{
35+
Fortran::semantics::MaybeIntExpr
36+
EvaluateIntExpr(Fortran::semantics::SemanticsContext &context, const T &expr) {
37+
if (Fortran::semantics::MaybeExpr maybeExpr{
3938
Fold(context.foldingContext(), AnalyzeExpr(context, expr))}) {
40-
if (auto *intExpr{Fortran::evaluate::UnwrapExpr<SomeIntExpr>(*maybeExpr)}) {
39+
if (auto *intExpr{
40+
Fortran::evaluate::UnwrapExpr<Fortran::semantics::SomeIntExpr>(
41+
*maybeExpr)}) {
4142
return std::move(*intExpr);
4243
}
4344
}
4445
return std::nullopt;
4546
}
4647

4748
template <typename T>
48-
std::optional<std::int64_t> EvaluateInt64(SemanticsContext &context,
49-
const T &expr) {
49+
std::optional<std::int64_t>
50+
EvaluateInt64(Fortran::semantics::SemanticsContext &context, const T &expr) {
5051
return Fortran::evaluate::ToInt64(EvaluateIntExpr(context, expr));
5152
}
5253

@@ -602,7 +603,8 @@ static void convertLoopBounds(lower::AbstractConverter &converter,
602603
/// contains a loop construct with an inner tiling construct.
603604
void collectTileSizesFromOpenMPConstruct(
604605
const parser::OpenMPConstruct *ompCons,
605-
llvm::SmallVectorImpl<int64_t> &tileSizes, SemanticsContext &semaCtx) {
606+
llvm::SmallVectorImpl<int64_t> &tileSizes,
607+
Fortran::semantics::SemanticsContext &semaCtx) {
606608
if (!ompCons)
607609
return;
608610

@@ -625,7 +627,7 @@ void collectTileSizesFromOpenMPConstruct(
625627
// Get the size values from parse tree and convert to a vector
626628
const auto &innerClauseList{
627629
std::get<parser::OmpClauseList>(innerBegin.t)};
628-
for (const auto &clause : innerClauseList.v)
630+
for (const auto &clause : innerClauseList.v) {
629631
if (const auto tclause{
630632
std::get_if<parser::OmpClause::Sizes>(&clause.u)}) {
631633
for (auto &tval : tclause->v) {
@@ -634,6 +636,7 @@ void collectTileSizesFromOpenMPConstruct(
634636
}
635637
break;
636638
}
639+
}
637640
}
638641
}
639642
}

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,15 +3047,15 @@ convertOmpLoopNest(Operation &opInst, llvm::IRBuilderBase &builder,
30473047
// Do tiling.
30483048
if (const auto &tiles = loopOp.getTileSizes()) {
30493049
llvm::Type *ivType = loopInfos.front()->getIndVarType();
3050-
SmallVector<llvm::Value *> TileSizes;
3050+
SmallVector<llvm::Value *> tileSizes;
30513051

30523052
for (auto tile : tiles.value()) {
3053-
llvm::Value *TileVal = llvm::ConstantInt::get(ivType, tile);
3054-
TileSizes.push_back(TileVal);
3053+
llvm::Value *tileVal = llvm::ConstantInt::get(ivType, tile);
3054+
tileSizes.push_back(tileVal);
30553055
}
30563056

30573057
std::vector<llvm::CanonicalLoopInfo *> newLoops =
3058-
ompBuilder->tileLoops(ompLoc.DL, loopInfos, TileSizes);
3058+
ompBuilder->tileLoops(ompLoc.DL, loopInfos, tileSizes);
30593059

30603060
// Update afterIP to get the correct insertion point after
30613061
// tiling.

0 commit comments

Comments
 (0)