Skip to content

Commit 11ff610

Browse files
wangzpgiHoney Goyal
authored andcommitted
[flang] [acc] Remove dead code after acc cache directive TODO (llvm#170729)
Remove unreachable code after the TODO in the acc cache directive lowering function.
1 parent 7222bd2 commit 11ff610

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

flang/lib/Lower/OpenACC.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4786,39 +4786,8 @@ static void
47864786
genACC(Fortran::lower::AbstractConverter &converter,
47874787
Fortran::semantics::SemanticsContext &semanticsContext,
47884788
const Fortran::parser::OpenACCCacheConstruct &cacheConstruct) {
4789-
fir::FirOpBuilder &builder = converter.getFirOpBuilder();
47904789
mlir::Location loc = converter.genLocation(cacheConstruct.source);
47914790
TODO(loc, "OpenACC cache directive");
4792-
auto loopOp = builder.getRegion().getParentOfType<mlir::acc::LoopOp>();
4793-
auto crtPos = builder.saveInsertionPoint();
4794-
if (loopOp) {
4795-
builder.setInsertionPoint(loopOp);
4796-
Fortran::lower::StatementContext stmtCtx;
4797-
llvm::SmallVector<mlir::Value> cacheOperands;
4798-
const Fortran::parser::AccObjectListWithModifier &listWithModifier =
4799-
std::get<Fortran::parser::AccObjectListWithModifier>(cacheConstruct.t);
4800-
const auto &accObjectList =
4801-
std::get<Fortran::parser::AccObjectList>(listWithModifier.t);
4802-
const auto &modifier =
4803-
std::get<std::optional<Fortran::parser::AccDataModifier>>(
4804-
listWithModifier.t);
4805-
4806-
mlir::acc::DataClause dataClause = mlir::acc::DataClause::acc_cache;
4807-
if (modifier &&
4808-
(*modifier).v == Fortran::parser::AccDataModifier::Modifier::ReadOnly)
4809-
dataClause = mlir::acc::DataClause::acc_cache_readonly;
4810-
genDataOperandOperations<mlir::acc::CacheOp>(
4811-
accObjectList, converter, semanticsContext, stmtCtx, cacheOperands,
4812-
dataClause,
4813-
/*structured=*/true, /*implicit=*/false,
4814-
/*async=*/{}, /*asyncDeviceTypes=*/{}, /*asyncOnlyDeviceTypes=*/{},
4815-
/*setDeclareAttr*/ false);
4816-
loopOp.getCacheOperandsMutable().append(cacheOperands);
4817-
} else {
4818-
llvm::report_fatal_error(
4819-
"could not find loop to attach OpenACC cache information.");
4820-
}
4821-
builder.restoreInsertionPoint(crtPos);
48224791
}
48234792

48244793
mlir::Value Fortran::lower::genOpenACCConstruct(

0 commit comments

Comments
 (0)