Skip to content

Commit

Permalink
fix UB with missing return
Browse files Browse the repository at this point in the history
  • Loading branch information
leissa committed Oct 16, 2024
1 parent 6b1e0be commit 7d856e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dialects/autodiff/analysis/war_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void WarAnalysis::run() {
std::cout << size << std::endl;
}

bool WarAnalysis::find(Lam* lam, const Def* mem) {
void WarAnalysis::find(Lam* lam, const Def* mem) {
auto op = unextract(mem);
if (auto app = match<mem::store>(op)) {
auto ptr = app->arg(1);
Expand Down Expand Up @@ -108,7 +108,7 @@ void WarAnalysis::wipe(Lam* lam) {
}
}

bool WarAnalysis::collect(Lam* lam, const Def* mem) {
void WarAnalysis::collect(Lam* lam, const Def* mem) {
auto op = unextract(mem);
if (auto app = match<mem::store>(op)) { stores->operator[](lam).insert(app); }

Expand Down
4 changes: 2 additions & 2 deletions dialects/autodiff/analysis/war_analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class WarAnalysis : public Analysis {

bool is_overwritten(const Def* def) { return overwritten.contains(def); }

bool find(Lam* lam, const Def* mem);
void find(Lam* lam, const Def* mem);

void find(Lam* lam);

void meet_stores(const Def* src, const Def* dst);

bool collect(Lam* lam, const Def* mem);
void collect(Lam* lam, const Def* mem);

void collect(Lam* lam);

Expand Down
2 changes: 1 addition & 1 deletion dialects/autodiff/passes/def_inliner.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class InferRewriter {
old2new_->map_global(old_def, new_def);
}

const Def* has(const Def* def) { old2new_->has(def); }
const Def* has(const Def* def) { return old2new_->has(def); }

const Def* new2old(const Def* def) { return new2old_[def]; }

Expand Down

0 comments on commit 7d856e7

Please sign in to comment.