Skip to content

Commit f347183

Browse files
authored
push_back(std::nullopt) and remove unnecessary lint disablers (#5329)
https://abseil.io/tips/112
1 parent 80c5574 commit f347183

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

csrc/alias_analysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ void AliasFinder::handle(const BroadcastOp* bcast) {
287287
for (const auto i : arange(out_logical.size())) {
288288
if (bcast->isBroadcastDim(i)) {
289289
out_allocation.push_back(out_logical[i]);
290-
out_contiguity.emplace_back(std::nullopt);
290+
out_contiguity.push_back(std::nullopt);
291291
}
292292
}
293293

csrc/ir/nodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3966,7 +3966,7 @@ std::vector<IterDomain*> TensorDomain::noDevices(
39663966
contiguity.reserve(allocation_domain.size());
39673967
for (auto id : allocation_domain) {
39683968
if (id->isBroadcast() || id->isReduction()) {
3969-
contiguity.emplace_back(std::nullopt);
3969+
contiguity.push_back(std::nullopt);
39703970
} else {
39713971
contiguity.emplace_back(fill_value);
39723972
}

csrc/transform_replay.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ void TransformReplay::selfReplay(
339339
for (auto* id : new_self->logical()) {
340340
if (id->isReduction()) {
341341
new_allocation.push_back(id);
342-
// NOLINTNEXTLINE(modernize-use-emplace)
343342
new_contiguities.push_back(std::nullopt);
344343
}
345344
}

0 commit comments

Comments
 (0)