Skip to content

Commit c7eae7f

Browse files
committed
[NFC] Minor cleanup
Re-created PR currently in ATD lost during merge to amd-staging.
1 parent 02bf7c6 commit c7eae7f

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ static void processHostEvalClauses(lower::AbstractConverter &converter,
556556
case OMPD_distribute_parallel_do:
557557
case OMPD_distribute_parallel_do_simd:
558558
cp.processNumThreads(stmtCtx, hostInfo.ops);
559+
[[fallthrough]];
559560
case OMPD_distribute:
560561
case OMPD_distribute_simd:
561562
cp.processCollapse(loc, eval, hostInfo.ops, hostInfo.iv);

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ static LogicalResult checkImplementationStatus(Operation &op) {
229229
result = todo("privatization");
230230
}
231231
};
232-
auto checkReduction = [&todo](auto op, LogicalResult &result) {
233-
if (!op.getReductionVars().empty() || op.getReductionByref() ||
234-
op.getReductionSyms())
235-
result = todo("reduction");
236-
};
237232
auto checkTaskReduction = [&todo](auto op, LogicalResult &result) {
238233
if (!op.getTaskReductionVars().empty() || op.getTaskReductionByref() ||
239234
op.getTaskReductionSyms())
@@ -1844,7 +1839,7 @@ static bool teamsReductionContainedInDistribute(omp::TeamsOp teamsOp) {
18441839
Operation *distOp = nullptr;
18451840
for (auto ra : iface.getReductionBlockArgs())
18461841
for (auto &use : ra.getUses()) {
1847-
auto useOp = use.getOwner();
1842+
auto *useOp = use.getOwner();
18481843
auto currentDistOp = useOp->getParentOfType<omp::DistributeOp>();
18491844
// Use is not inside a distribute op - return false
18501845
if (!currentDistOp)
@@ -4689,7 +4684,7 @@ static std::optional<int64_t> extractConstInteger(Value value) {
46894684
return std::nullopt;
46904685
}
46914686

4692-
static uint64_t getTypeByteSize(mlir::Type type, DataLayout dl) {
4687+
static uint64_t getTypeByteSize(mlir::Type type, const DataLayout &dl) {
46934688
uint64_t sizeInBits = dl.getTypeSizeInBits(type);
46944689
uint64_t sizeInBytes = sizeInBits / 8;
46954690
return sizeInBytes;
@@ -4708,10 +4703,6 @@ static uint64_t getReductionDataSize(OpTy &op) {
47084703
return 0;
47094704
}
47104705

4711-
static uint64_t getTeamsReductionDataSize(mlir::omp::TeamsOp &teamsOp) {
4712-
return getReductionDataSize<mlir::omp::TeamsOp>(teamsOp);
4713-
}
4714-
47154706
/// Populate default `MinTeams`, `MaxTeams` and `MaxThreads` to their default
47164707
/// values as stated by the corresponding clauses, if constant.
47174708
///
@@ -4809,7 +4800,7 @@ initTargetDefaultAttrs(omp::TargetOp targetOp,
48094800
int32_t reductionDataSize = 0;
48104801
if (isGPU && capturedOp) {
48114802
if (auto teamsOp = castOrGetParentOfType<omp::TeamsOp>(capturedOp))
4812-
reductionDataSize = getTeamsReductionDataSize(teamsOp);
4803+
reductionDataSize = getReductionDataSize(teamsOp);
48134804
}
48144805

48154806
// Update kernel attrs structure for the `OpenMPIRBuilder` to use.

0 commit comments

Comments
 (0)