Skip to content

Commit

Permalink
Auto Format
Browse files Browse the repository at this point in the history
  • Loading branch information
taichi-gardener committed Oct 20, 2021
1 parent 0240299 commit 0bd8dd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions taichi/analysis/alias_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ AliasResult alias_analysis(Stmt *var1, Stmt *var2) {
if (origin1 != nullptr && origin2 != nullptr) {
if (origin1 == origin2) {
if (var1->is<PtrOffsetStmt>() && var2->is<PtrOffsetStmt>()) {
auto diff = value_diff_ptr_index(var1->cast<PtrOffsetStmt>()->offset, var2->cast<PtrOffsetStmt>()->offset);
auto diff = value_diff_ptr_index(var1->cast<PtrOffsetStmt>()->offset,
var2->cast<PtrOffsetStmt>()->offset);
if (diff.is_diff_certain) {
return diff.diff_range == 0 ? AliasResult::same : AliasResult::different;
return diff.diff_range == 0 ? AliasResult::same
: AliasResult::different;
}
}
return AliasResult::uncertain;
Expand Down
3 changes: 2 additions & 1 deletion taichi/ir/control_flow_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,8 @@ void ControlFlowGraph::live_variable_analysis(
if (stmt->is<AllocaStmt>() || stmt->is<AdStackAllocaStmt>()) {
return false;
}
if (stmt->is<PtrOffsetStmt>() && stmt->cast<PtrOffsetStmt>()->origin->is<AllocaStmt>()) {
if (stmt->is<PtrOffsetStmt>() &&
stmt->cast<PtrOffsetStmt>()->origin->is<AllocaStmt>()) {
return false;
}
if (auto *gptr = stmt->cast<GlobalPtrStmt>();
Expand Down

0 comments on commit 0bd8dd7

Please sign in to comment.